Skip to main content

bitwarden_api_api/models/
subscription_preview.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 SubscriptionPreview {
17    #[serde(rename = "status", alias = "Status")]
18    pub status: Option<String>,
19    #[serde(rename = "invoicePreview", alias = "InvoicePreview")]
20    pub invoice_preview: Box<models::InvoicePreview>,
21    #[serde(
22        rename = "storage",
23        alias = "Storage",
24        skip_serializing_if = "Option::is_none"
25    )]
26    pub storage: Option<Box<models::Storage>>,
27    #[serde(
28        rename = "cancelAt",
29        alias = "CancelAt",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub cancel_at: Option<String>,
33    #[serde(
34        rename = "canceled",
35        alias = "Canceled",
36        skip_serializing_if = "Option::is_none"
37    )]
38    pub canceled: Option<String>,
39    #[serde(
40        rename = "suspension",
41        alias = "Suspension",
42        skip_serializing_if = "Option::is_none"
43    )]
44    pub suspension: Option<String>,
45    #[serde(
46        rename = "gracePeriod",
47        alias = "GracePeriod",
48        skip_serializing_if = "Option::is_none"
49    )]
50    pub grace_period: Option<i32>,
51    #[serde(
52        rename = "pendingChange",
53        alias = "PendingChange",
54        skip_serializing_if = "Option::is_none"
55    )]
56    pub pending_change: Option<Box<models::PendingSubscriptionChange>>,
57}
58
59impl SubscriptionPreview {
60    pub fn new(
61        status: Option<String>,
62        invoice_preview: models::InvoicePreview,
63    ) -> SubscriptionPreview {
64        SubscriptionPreview {
65            status,
66            invoice_preview: Box::new(invoice_preview),
67            storage: None,
68            cancel_at: None,
69            canceled: None,
70            suspension: None,
71            grace_period: None,
72            pending_change: None,
73        }
74    }
75}