bitwarden_api_api/models/
create_client_organization_request_body.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
/*
 * 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 CreateClientOrganizationRequestBody {
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "ownerEmail")]
    pub owner_email: String,
    #[serde(rename = "planType", skip_serializing_if = "Option::is_none")]
    pub plan_type: Option<models::PlanType>,
    #[serde(rename = "seats", skip_serializing_if = "Option::is_none")]
    pub seats: Option<i32>,
    #[serde(rename = "key")]
    pub key: String,
    #[serde(rename = "keyPair")]
    pub key_pair: Box<models::KeyPairRequestBody>,
    #[serde(rename = "collectionName")]
    pub collection_name: String,
}

impl CreateClientOrganizationRequestBody {
    pub fn new(
        name: String,
        owner_email: String,
        key: String,
        key_pair: models::KeyPairRequestBody,
        collection_name: String,
    ) -> CreateClientOrganizationRequestBody {
        CreateClientOrganizationRequestBody {
            name,
            owner_email,
            plan_type: None,
            seats: None,
            key,
            key_pair: Box::new(key_pair),
            collection_name,
        }
    }
}