bitwarden_api_api/models/
premium_cloud_hosted_subscription_request.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 PremiumCloudHostedSubscriptionRequest {
17    #[serde(
18        rename = "tokenizedPaymentMethod",
19        alias = "TokenizedPaymentMethod",
20        skip_serializing_if = "Option::is_none"
21    )]
22    pub tokenized_payment_method: Option<Box<models::MinimalTokenizedPaymentMethodRequest>>,
23    #[serde(
24        rename = "nonTokenizedPaymentMethod",
25        alias = "NonTokenizedPaymentMethod",
26        skip_serializing_if = "Option::is_none"
27    )]
28    pub non_tokenized_payment_method: Option<Box<models::NonTokenizedPaymentMethodRequest>>,
29    #[serde(rename = "billingAddress", alias = "BillingAddress")]
30    pub billing_address: Box<models::MinimalBillingAddressRequest>,
31    #[serde(
32        rename = "additionalStorageGb",
33        alias = "AdditionalStorageGb",
34        skip_serializing_if = "Option::is_none"
35    )]
36    pub additional_storage_gb: Option<i32>,
37}
38
39impl PremiumCloudHostedSubscriptionRequest {
40    pub fn new(
41        billing_address: models::MinimalBillingAddressRequest,
42    ) -> PremiumCloudHostedSubscriptionRequest {
43        PremiumCloudHostedSubscriptionRequest {
44            tokenized_payment_method: None,
45            non_tokenized_payment_method: None,
46            billing_address: Box::new(billing_address),
47            additional_storage_gb: None,
48        }
49    }
50}