bitwarden_api_api/models/
organization_create_request_model.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/*
 * Bitwarden Internal API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: latest
 *
 * Generated by: https://openapi-generator.tech
 */

use serde::{Deserialize, Serialize};

use crate::models;

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OrganizationCreateRequestModel {
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "businessName", skip_serializing_if = "Option::is_none")]
    pub business_name: Option<String>,
    #[serde(rename = "billingEmail")]
    pub billing_email: String,
    #[serde(rename = "planType", skip_serializing_if = "Option::is_none")]
    pub plan_type: Option<models::PlanType>,
    #[serde(rename = "key")]
    pub key: String,
    #[serde(rename = "keys", skip_serializing_if = "Option::is_none")]
    pub keys: Option<Box<models::OrganizationKeysRequestModel>>,
    #[serde(rename = "paymentMethodType", skip_serializing_if = "Option::is_none")]
    pub payment_method_type: Option<models::PaymentMethodType>,
    #[serde(rename = "paymentToken", skip_serializing_if = "Option::is_none")]
    pub payment_token: Option<String>,
    #[serde(rename = "additionalSeats", skip_serializing_if = "Option::is_none")]
    pub additional_seats: Option<i32>,
    #[serde(
        rename = "additionalStorageGb",
        skip_serializing_if = "Option::is_none"
    )]
    pub additional_storage_gb: Option<i32>,
    #[serde(rename = "premiumAccessAddon", skip_serializing_if = "Option::is_none")]
    pub premium_access_addon: Option<bool>,
    #[serde(rename = "collectionName", skip_serializing_if = "Option::is_none")]
    pub collection_name: Option<String>,
    #[serde(rename = "taxIdNumber", skip_serializing_if = "Option::is_none")]
    pub tax_id_number: Option<String>,
    #[serde(
        rename = "billingAddressLine1",
        skip_serializing_if = "Option::is_none"
    )]
    pub billing_address_line1: Option<String>,
    #[serde(
        rename = "billingAddressLine2",
        skip_serializing_if = "Option::is_none"
    )]
    pub billing_address_line2: Option<String>,
    #[serde(rename = "billingAddressCity", skip_serializing_if = "Option::is_none")]
    pub billing_address_city: Option<String>,
    #[serde(
        rename = "billingAddressState",
        skip_serializing_if = "Option::is_none"
    )]
    pub billing_address_state: Option<String>,
    #[serde(
        rename = "billingAddressPostalCode",
        skip_serializing_if = "Option::is_none"
    )]
    pub billing_address_postal_code: Option<String>,
    #[serde(
        rename = "billingAddressCountry",
        skip_serializing_if = "Option::is_none"
    )]
    pub billing_address_country: Option<String>,
    #[serde(rename = "maxAutoscaleSeats", skip_serializing_if = "Option::is_none")]
    pub max_autoscale_seats: Option<i32>,
    #[serde(rename = "additionalSmSeats", skip_serializing_if = "Option::is_none")]
    pub additional_sm_seats: Option<i32>,
    #[serde(
        rename = "additionalServiceAccounts",
        skip_serializing_if = "Option::is_none"
    )]
    pub additional_service_accounts: Option<i32>,
    #[serde(rename = "useSecretsManager")]
    pub use_secrets_manager: bool,
    #[serde(
        rename = "isFromSecretsManagerTrial",
        skip_serializing_if = "Option::is_none"
    )]
    pub is_from_secrets_manager_trial: Option<bool>,
    #[serde(rename = "initiationPath", skip_serializing_if = "Option::is_none")]
    pub initiation_path: Option<String>,
}

impl OrganizationCreateRequestModel {
    pub fn new(
        name: String,
        billing_email: String,
        key: String,
        use_secrets_manager: bool,
    ) -> OrganizationCreateRequestModel {
        OrganizationCreateRequestModel {
            name,
            business_name: None,
            billing_email,
            plan_type: None,
            key,
            keys: None,
            payment_method_type: None,
            payment_token: None,
            additional_seats: None,
            additional_storage_gb: None,
            premium_access_addon: None,
            collection_name: None,
            tax_id_number: None,
            billing_address_line1: None,
            billing_address_line2: None,
            billing_address_city: None,
            billing_address_state: None,
            billing_address_postal_code: None,
            billing_address_country: None,
            max_autoscale_seats: None,
            additional_sm_seats: None,
            additional_service_accounts: None,
            use_secrets_manager,
            is_from_secrets_manager_trial: None,
            initiation_path: None,
        }
    }
}