Skip to main content

nominal_api/conjure/objects/scout/video/api/
ingest_error.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 IngestError {
16    #[serde(rename = "errorType")]
17    error_type: super::ErrorType,
18    #[builder(into)]
19    #[serde(rename = "message")]
20    message: String,
21    #[builder(default, into)]
22    #[serde(
23        rename = "errorInstanceId",
24        skip_serializing_if = "Option::is_none",
25        default
26    )]
27    error_instance_id: Option<String>,
28}
29impl IngestError {
30    /// Constructs a new instance of the type.
31    #[inline]
32    pub fn new(error_type: super::ErrorType, message: impl Into<String>) -> Self {
33        Self::builder().error_type(error_type).message(message).build()
34    }
35    #[inline]
36    pub fn error_type(&self) -> &super::ErrorType {
37        &self.error_type
38    }
39    #[inline]
40    pub fn message(&self) -> &str {
41        &*self.message
42    }
43    #[inline]
44    pub fn error_instance_id(&self) -> Option<&str> {
45        self.error_instance_id.as_ref().map(|o| &**o)
46    }
47}