Skip to main content

bitwarden_api_api/models/
invoice_preview_discount.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 InvoicePreviewDiscount {
17    #[serde(rename = "type", alias = "R#type")]
18    pub r#type: models::BitwardenDiscountType,
19    #[serde(rename = "value", alias = "Value")]
20    pub value: f64,
21    #[serde(rename = "amount", alias = "Amount")]
22    pub amount: f64,
23    #[serde(
24        rename = "label",
25        alias = "Label",
26        skip_serializing_if = "Option::is_none"
27    )]
28    pub label: Option<String>,
29}
30
31impl InvoicePreviewDiscount {
32    pub fn new(
33        r#type: models::BitwardenDiscountType,
34        value: f64,
35        amount: f64,
36    ) -> InvoicePreviewDiscount {
37        InvoicePreviewDiscount {
38            r#type,
39            value,
40            amount,
41            label: None,
42        }
43    }
44}