Skip to main content

bitwarden_api_api/models/
create_organization_invite_link_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 CreateOrganizationInviteLinkRequestModel {
17    /// Email domains permitted to accept the invite link (e.g. `[\"acme.com\"]`).
18    #[serde(rename = "allowedDomains", alias = "AllowedDomains")]
19    pub allowed_domains: Vec<String>,
20    /// The invite key encrypted with the organization key.
21    #[serde(rename = "encryptedInviteKey", alias = "EncryptedInviteKey")]
22    pub encrypted_invite_key: String,
23    /// The organization key encrypted for the invite link. Currently unused; will be populated in
24    /// a future stage.
25    #[serde(
26        rename = "encryptedOrgKey",
27        alias = "EncryptedOrgKey",
28        skip_serializing_if = "Option::is_none"
29    )]
30    pub encrypted_org_key: Option<String>,
31}
32
33impl CreateOrganizationInviteLinkRequestModel {
34    pub fn new(
35        allowed_domains: Vec<String>,
36        encrypted_invite_key: String,
37    ) -> CreateOrganizationInviteLinkRequestModel {
38        CreateOrganizationInviteLinkRequestModel {
39            allowed_domains,
40            encrypted_invite_key,
41            encrypted_org_key: None,
42        }
43    }
44}