Skip to main content

aws_sdk_connect/types/error/
_invalid_contact_flow_module_exception.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The problems with the module. Please fix before trying again.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct InvalidContactFlowModuleException {
7    #[allow(missing_docs)] // documentation missing in model
8    pub problems: ::std::option::Option<::std::vec::Vec<crate::types::ProblemDetail>>,
9    #[allow(missing_docs)] // documentation missing in model
10    pub message: ::std::option::Option<::std::string::String>,
11    pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
12}
13impl InvalidContactFlowModuleException {
14    #[allow(missing_docs)] // documentation missing in model
15    ///
16    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.problems.is_none()`.
17    pub fn problems(&self) -> &[crate::types::ProblemDetail] {
18        self.problems.as_deref().unwrap_or_default()
19    }
20}
21impl InvalidContactFlowModuleException {
22    /// Returns the error message.
23    pub fn message(&self) -> ::std::option::Option<&str> {
24        self.message.as_deref()
25    }
26}
27impl ::std::fmt::Display for InvalidContactFlowModuleException {
28    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
29        ::std::write!(f, "InvalidContactFlowModuleException")?;
30        if let ::std::option::Option::Some(inner_1) = &self.message {
31            {
32                ::std::write!(f, ": {inner_1}")?;
33            }
34        }
35        Ok(())
36    }
37}
38impl ::std::error::Error for InvalidContactFlowModuleException {}
39impl ::aws_types::request_id::RequestId for crate::types::error::InvalidContactFlowModuleException {
40    fn request_id(&self) -> Option<&str> {
41        use ::aws_smithy_types::error::metadata::ProvideErrorMetadata;
42        self.meta().request_id()
43    }
44}
45impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for InvalidContactFlowModuleException {
46    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
47        &self.meta
48    }
49}
50impl InvalidContactFlowModuleException {
51    /// Creates a new builder-style object to manufacture [`InvalidContactFlowModuleException`](crate::types::error::InvalidContactFlowModuleException).
52    pub fn builder() -> crate::types::error::builders::InvalidContactFlowModuleExceptionBuilder {
53        crate::types::error::builders::InvalidContactFlowModuleExceptionBuilder::default()
54    }
55}
56
57/// A builder for [`InvalidContactFlowModuleException`](crate::types::error::InvalidContactFlowModuleException).
58#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
59#[non_exhaustive]
60pub struct InvalidContactFlowModuleExceptionBuilder {
61    pub(crate) problems: ::std::option::Option<::std::vec::Vec<crate::types::ProblemDetail>>,
62    pub(crate) message: ::std::option::Option<::std::string::String>,
63    meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
64}
65impl InvalidContactFlowModuleExceptionBuilder {
66    /// Appends an item to `problems`.
67    ///
68    /// To override the contents of this collection use [`set_problems`](Self::set_problems).
69    ///
70    pub fn problems(mut self, input: crate::types::ProblemDetail) -> Self {
71        let mut v = self.problems.unwrap_or_default();
72        v.push(input);
73        self.problems = ::std::option::Option::Some(v);
74        self
75    }
76    #[allow(missing_docs)] // documentation missing in model
77    pub fn set_problems(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ProblemDetail>>) -> Self {
78        self.problems = input;
79        self
80    }
81    #[allow(missing_docs)] // documentation missing in model
82    pub fn get_problems(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ProblemDetail>> {
83        &self.problems
84    }
85    #[allow(missing_docs)] // documentation missing in model
86    pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87        self.message = ::std::option::Option::Some(input.into());
88        self
89    }
90    #[allow(missing_docs)] // documentation missing in model
91    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
92        self.message = input;
93        self
94    }
95    #[allow(missing_docs)] // documentation missing in model
96    pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
97        &self.message
98    }
99    /// Sets error metadata
100    pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
101        self.meta = Some(meta);
102        self
103    }
104
105    /// Sets error metadata
106    pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
107        self.meta = meta;
108        self
109    }
110    /// Consumes the builder and constructs a [`InvalidContactFlowModuleException`](crate::types::error::InvalidContactFlowModuleException).
111    pub fn build(self) -> crate::types::error::InvalidContactFlowModuleException {
112        crate::types::error::InvalidContactFlowModuleException {
113            problems: self.problems,
114            message: self.message,
115            meta: self.meta.unwrap_or_default(),
116        }
117    }
118}