Skip to main content

nominal_api/conjure/objects/api/
error_result.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    PartialEq,
7    Eq,
8    PartialOrd,
9    Ord,
10    Hash
11)]
12#[serde(crate = "conjure_object::serde")]
13#[conjure_object::private::staged_builder::staged_builder]
14#[builder(crate = conjure_object::private::staged_builder, update, inline)]
15pub struct ErrorResult {
16    #[serde(rename = "errorType")]
17    error_type: super::ErrorType,
18    #[builder(into)]
19    #[serde(rename = "message")]
20    message: String,
21}
22impl ErrorResult {
23    /// Constructs a new instance of the type.
24    #[inline]
25    pub fn new(error_type: super::ErrorType, message: impl Into<String>) -> Self {
26        Self::builder().error_type(error_type).message(message).build()
27    }
28    #[inline]
29    pub fn error_type(&self) -> &super::ErrorType {
30        &self.error_type
31    }
32    #[inline]
33    pub fn message(&self) -> &str {
34        &*self.message
35    }
36}