Skip to main content

nominal_api/conjure/objects/authentication/api/
batch_preregister_users_request.rs

1/// Request to batch preregister users in the caller's organization.
2/// Only creates new users for emails that don't already exist.
3/// Newly created users are stored with an email claim matching their email address.
4/// Maximum of 1000 emails per request.
5#[derive(
6    Debug,
7    Clone,
8    conjure_object::serde::Serialize,
9    conjure_object::serde::Deserialize,
10    PartialEq,
11    Eq,
12    PartialOrd,
13    Ord,
14    Hash
15)]
16#[serde(crate = "conjure_object::serde")]
17#[conjure_object::private::staged_builder::staged_builder]
18#[builder(crate = conjure_object::private::staged_builder, update, inline)]
19pub struct BatchPreregisterUsersRequest {
20    #[builder(default, list(item(type = String, into)))]
21    #[serde(rename = "emails", skip_serializing_if = "Vec::is_empty", default)]
22    emails: Vec<String>,
23}
24impl BatchPreregisterUsersRequest {
25    /// Constructs a new instance of the type.
26    #[inline]
27    pub fn new() -> Self {
28        Self::builder().build()
29    }
30    /// The list of email addresses to preregister. Maximum 1000 entries.
31    #[inline]
32    pub fn emails(&self) -> &[String] {
33        &*self.emails
34    }
35}