bitwarden_api_api/models/
billing_address_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 BillingAddressRequest {
17    #[serde(rename = "country", alias = "Country")]
18    pub country: String,
19    #[serde(rename = "postalCode", alias = "PostalCode")]
20    pub postal_code: String,
21    #[serde(
22        rename = "taxId",
23        alias = "TaxId",
24        skip_serializing_if = "Option::is_none"
25    )]
26    pub tax_id: Option<Box<models::TaxIdRequest>>,
27    #[serde(
28        rename = "line1",
29        alias = "Line1",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub line1: Option<String>,
33    #[serde(
34        rename = "line2",
35        alias = "Line2",
36        skip_serializing_if = "Option::is_none"
37    )]
38    pub line2: Option<String>,
39    #[serde(
40        rename = "city",
41        alias = "City",
42        skip_serializing_if = "Option::is_none"
43    )]
44    pub city: Option<String>,
45    #[serde(
46        rename = "state",
47        alias = "State",
48        skip_serializing_if = "Option::is_none"
49    )]
50    pub state: Option<String>,
51}
52
53impl BillingAddressRequest {
54    pub fn new(country: String, postal_code: String) -> BillingAddressRequest {
55        BillingAddressRequest {
56            country,
57            postal_code,
58            tax_id: None,
59            line1: None,
60            line2: None,
61            city: None,
62            state: None,
63        }
64    }
65}