Skip to main content

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

1/// Response containing only the newly created users keyed by email.
2/// Emails that already had existing accounts are silently skipped.
3#[derive(
4    Debug,
5    Clone,
6    conjure_object::serde::Serialize,
7    conjure_object::serde::Deserialize,
8    PartialEq,
9    Eq,
10    PartialOrd,
11    Ord,
12    Hash
13)]
14#[serde(crate = "conjure_object::serde")]
15#[conjure_object::private::staged_builder::staged_builder]
16#[builder(crate = conjure_object::private::staged_builder, update, inline)]
17pub struct BatchPreregisterUsersResponse {
18    #[builder(default, map(key(type = String, into), value(type = super::UserV2)))]
19    #[serde(
20        rename = "users",
21        skip_serializing_if = "std::collections::BTreeMap::is_empty",
22        default
23    )]
24    users: std::collections::BTreeMap<String, super::UserV2>,
25}
26impl BatchPreregisterUsersResponse {
27    /// Constructs a new instance of the type.
28    #[inline]
29    pub fn new() -> Self {
30        Self::builder().build()
31    }
32    /// Map of email to UserV2 for each newly created user.
33    #[inline]
34    pub fn users(&self) -> &std::collections::BTreeMap<String, super::UserV2> {
35        &self.users
36    }
37}