Skip to main content

nominal_api_conjure/conjure/objects/authorization/
okta_registration_error.rs

1/// Okta inline hook error object displayed to the end user when registration is denied.
2/// Custom messages are surfaced from errorCauses[].errorSummary with a location pointing
3/// at a user profile attribute; the top-level errorSummary alone is not shown to users.
4#[derive(
5    Debug,
6    Clone,
7    conjure_object::serde::Serialize,
8    conjure_object::serde::Deserialize,
9    PartialEq,
10    Eq,
11    PartialOrd,
12    Ord,
13    Hash
14)]
15#[serde(crate = "conjure_object::serde")]
16#[conjure_object::private::staged_builder::staged_builder]
17#[builder(crate = conjure_object::private::staged_builder, update, inline)]
18pub struct OktaRegistrationError {
19    #[builder(into)]
20    #[serde(rename = "errorSummary")]
21    error_summary: String,
22    #[builder(default, into)]
23    #[serde(rename = "errorCauses", skip_serializing_if = "Option::is_none", default)]
24    error_causes: Option<Vec<super::OktaRegistrationErrorCause>>,
25}
26impl OktaRegistrationError {
27    /// Constructs a new instance of the type.
28    #[inline]
29    pub fn new(error_summary: impl Into<String>) -> Self {
30        Self::builder().error_summary(error_summary).build()
31    }
32    #[inline]
33    pub fn error_summary(&self) -> &str {
34        &*self.error_summary
35    }
36    #[inline]
37    pub fn error_causes(&self) -> Option<&[super::OktaRegistrationErrorCause]> {
38        self.error_causes.as_ref().map(|o| &**o)
39    }
40}