aws_sdk_route53resolver/types/error/
_invalid_parameter_exception.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct InvalidParameterException {
7 #[allow(missing_docs)] pub message: ::std::string::String,
9 pub field_name: ::std::option::Option<::std::string::String>,
11 pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
12}
13impl InvalidParameterException {
14 pub fn field_name(&self) -> ::std::option::Option<&str> {
16 self.field_name.as_deref()
17 }
18}
19impl InvalidParameterException {
20 pub fn message(&self) -> &str {
22 &self.message
23 }
24}
25impl ::std::fmt::Display for InvalidParameterException {
26 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
27 ::std::write!(f, "InvalidParameterException")?;
28 {
29 ::std::write!(f, ": {}", &self.message)?;
30 }
31 Ok(())
32 }
33}
34impl ::std::error::Error for InvalidParameterException {}
35impl ::aws_types::request_id::RequestId for crate::types::error::InvalidParameterException {
36 fn request_id(&self) -> Option<&str> {
37 use ::aws_smithy_types::error::metadata::ProvideErrorMetadata;
38 self.meta().request_id()
39 }
40}
41impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for InvalidParameterException {
42 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
43 &self.meta
44 }
45}
46impl InvalidParameterException {
47 pub fn builder() -> crate::types::error::builders::InvalidParameterExceptionBuilder {
49 crate::types::error::builders::InvalidParameterExceptionBuilder::default()
50 }
51}
52
53#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
55#[non_exhaustive]
56pub struct InvalidParameterExceptionBuilder {
57 pub(crate) message: ::std::option::Option<::std::string::String>,
58 pub(crate) field_name: ::std::option::Option<::std::string::String>,
59 meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
60}
61impl InvalidParameterExceptionBuilder {
62 #[allow(missing_docs)] pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
65 self.message = ::std::option::Option::Some(input.into());
66 self
67 }
68 #[allow(missing_docs)] pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
70 self.message = input;
71 self
72 }
73 #[allow(missing_docs)] pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
75 &self.message
76 }
77 pub fn field_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
79 self.field_name = ::std::option::Option::Some(input.into());
80 self
81 }
82 pub fn set_field_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
84 self.field_name = input;
85 self
86 }
87 pub fn get_field_name(&self) -> &::std::option::Option<::std::string::String> {
89 &self.field_name
90 }
91 pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
93 self.meta = Some(meta);
94 self
95 }
96
97 pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
99 self.meta = meta;
100 self
101 }
102 pub fn build(self) -> ::std::result::Result<crate::types::error::InvalidParameterException, ::aws_smithy_types::error::operation::BuildError> {
106 ::std::result::Result::Ok(crate::types::error::InvalidParameterException {
107 message: self.message.ok_or_else(|| {
108 ::aws_smithy_types::error::operation::BuildError::missing_field(
109 "message",
110 "message was not specified but it is required when building InvalidParameterException",
111 )
112 })?,
113 field_name: self.field_name,
114 meta: self.meta.unwrap_or_default(),
115 })
116 }
117}