Skip to main content

bitwarden_api_api/models/
invoice_preview_item.rs

1/*
2 * Bitwarden Internal API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: latest
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use serde::{Deserialize, Serialize};
12
13use crate::models;
14
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct InvoicePreviewItem {
17    #[serde(rename = "reference", alias = "Reference")]
18    pub reference: Option<String>,
19    #[serde(rename = "quantity", alias = "Quantity")]
20    pub quantity: i64,
21    #[serde(rename = "cost", alias = "Cost")]
22    pub cost: f64,
23    #[serde(
24        rename = "discounts",
25        alias = "Discounts",
26        skip_serializing_if = "Option::is_none"
27    )]
28    pub discounts: Option<Vec<models::InvoicePreviewDiscount>>,
29}
30
31impl InvoicePreviewItem {
32    pub fn new(reference: Option<String>, quantity: i64, cost: f64) -> InvoicePreviewItem {
33        InvoicePreviewItem {
34            reference,
35            quantity,
36            cost,
37            discounts: None,
38        }
39    }
40}