quicknode_sdk/admin/
billing.rs1#[cfg(feature = "node")]
2use napi_derive::napi;
3#[cfg(feature = "python")]
4use pyo3::pyclass;
5#[cfg(feature = "python")]
6use pyo3_stub_gen::derive::gen_stub_pyclass;
7use serde::{Deserialize, Serialize};
8
9#[cfg_attr(feature = "python", gen_stub_pyclass)]
11#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
12#[cfg_attr(feature = "node", napi(object))]
13#[derive(Debug, Clone, Serialize, Deserialize)]
14pub struct InvoiceLine {
15 pub description: String,
17 pub amount: i64,
19}
20
21#[cfg_attr(feature = "python", gen_stub_pyclass)]
23#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
24#[cfg_attr(feature = "node", napi(object))]
25#[derive(Debug, Clone, Serialize, Deserialize)]
26pub struct Invoice {
27 pub id: String,
29 pub status: String,
31 pub billing_reason: String,
33 #[serde(default)]
35 pub lines: Vec<InvoiceLine>,
36 pub amount_due: i64,
38 pub amount_paid: i64,
40 pub period_start: i64,
42 pub period_end: i64,
44 pub created: i64,
46 pub subtotal: i64,
48}
49
50#[cfg_attr(feature = "python", gen_stub_pyclass)]
52#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
53#[cfg_attr(feature = "node", napi(object))]
54#[derive(Debug, Clone, Serialize, Deserialize)]
55pub struct ListInvoicesResponse {
56 pub data: Option<ListInvoicesData>,
58 pub error: Option<String>,
60}
61
62#[cfg_attr(feature = "python", gen_stub_pyclass)]
64#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
65#[cfg_attr(feature = "node", napi(object))]
66#[derive(Debug, Clone, Serialize, Deserialize)]
67pub struct ListInvoicesData {
68 #[serde(default)]
70 pub invoices: Vec<Invoice>,
71}
72
73#[cfg_attr(feature = "python", gen_stub_pyclass)]
75#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
76#[cfg_attr(feature = "node", napi(object))]
77#[derive(Debug, Clone, Serialize, Deserialize)]
78pub struct Payment {
79 pub amount: String,
81 pub card_last_4: Option<String>,
83 pub created_at: String,
85 pub currency: String,
87 pub status: String,
89 pub marketplace_amount: Option<String>,
91}
92
93#[cfg_attr(feature = "python", gen_stub_pyclass)]
95#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
96#[cfg_attr(feature = "node", napi(object))]
97#[derive(Debug, Clone, Serialize, Deserialize)]
98pub struct ListPaymentsResponse {
99 pub data: Option<ListPaymentsData>,
101 pub error: Option<String>,
103}
104
105#[cfg_attr(feature = "python", gen_stub_pyclass)]
107#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
108#[cfg_attr(feature = "node", napi(object))]
109#[derive(Debug, Clone, Serialize, Deserialize)]
110pub struct ListPaymentsData {
111 #[serde(default)]
113 pub payments: Vec<Payment>,
114}