bitwarden_api_api/models/
payment_request_model.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 PaymentRequestModel {
17    #[serde(rename = "country")]
18    pub country: String,
19    #[serde(rename = "postalCode", skip_serializing_if = "Option::is_none")]
20    pub postal_code: Option<String>,
21    #[serde(rename = "taxId", skip_serializing_if = "Option::is_none")]
22    pub tax_id: Option<String>,
23    #[serde(rename = "line1", skip_serializing_if = "Option::is_none")]
24    pub line1: Option<String>,
25    #[serde(rename = "line2", skip_serializing_if = "Option::is_none")]
26    pub line2: Option<String>,
27    #[serde(rename = "city", skip_serializing_if = "Option::is_none")]
28    pub city: Option<String>,
29    #[serde(rename = "state", skip_serializing_if = "Option::is_none")]
30    pub state: Option<String>,
31    #[serde(rename = "paymentMethodType")]
32    pub payment_method_type: models::PaymentMethodType,
33    #[serde(rename = "paymentToken")]
34    pub payment_token: String,
35}
36
37impl PaymentRequestModel {
38    pub fn new(
39        country: String,
40        payment_method_type: models::PaymentMethodType,
41        payment_token: String,
42    ) -> PaymentRequestModel {
43        PaymentRequestModel {
44            country,
45            postal_code: None,
46            tax_id: None,
47            line1: None,
48            line2: None,
49            city: None,
50            state: None,
51            payment_method_type,
52            payment_token,
53        }
54    }
55}