bitwarden-api-api 3.0.0

Api bindings for the Bitwarden API.
Documentation
/*
 * 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 CreateOrganizationInviteLinkRequestModel {
    /// Email domains permitted to accept the invite link (e.g. `[\"acme.com\"]`).
    #[serde(rename = "allowedDomains", alias = "AllowedDomains")]
    pub allowed_domains: Vec<String>,
    /// The invite key encrypted with the organization key.
    #[serde(rename = "encryptedInviteKey", alias = "EncryptedInviteKey")]
    pub encrypted_invite_key: String,
    /// The organization key encrypted for the invite link. Currently unused; will be populated in
    /// a future stage.
    #[serde(
        rename = "encryptedOrgKey",
        alias = "EncryptedOrgKey",
        skip_serializing_if = "Option::is_none"
    )]
    pub encrypted_org_key: Option<String>,
}

impl CreateOrganizationInviteLinkRequestModel {
    pub fn new(
        allowed_domains: Vec<String>,
        encrypted_invite_key: String,
    ) -> CreateOrganizationInviteLinkRequestModel {
        CreateOrganizationInviteLinkRequestModel {
            allowed_domains,
            encrypted_invite_key,
            encrypted_org_key: None,
        }
    }
}