aws_sdk_sns/types/error/
_verification_exception.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct VerificationException {
7 #[allow(missing_docs)] pub message: ::std::string::String,
9 pub status: ::std::string::String,
11 pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
12}
13impl VerificationException {
14 pub fn status(&self) -> &str {
16 use std::ops::Deref;
17 self.status.deref()
18 }
19}
20impl VerificationException {
21 pub fn message(&self) -> &str {
23 &self.message
24 }
25}
26impl ::std::fmt::Display for VerificationException {
27 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
28 ::std::write!(f, "VerificationException")?;
29 {
30 ::std::write!(f, ": {}", &self.message)?;
31 }
32 Ok(())
33 }
34}
35impl ::std::error::Error for VerificationException {}
36impl ::aws_types::request_id::RequestId for crate::types::error::VerificationException {
37 fn request_id(&self) -> Option<&str> {
38 use ::aws_smithy_types::error::metadata::ProvideErrorMetadata;
39 self.meta().request_id()
40 }
41}
42impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for VerificationException {
43 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
44 &self.meta
45 }
46}
47impl VerificationException {
48 pub fn builder() -> crate::types::error::builders::VerificationExceptionBuilder {
50 crate::types::error::builders::VerificationExceptionBuilder::default()
51 }
52}
53
54#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
56#[non_exhaustive]
57pub struct VerificationExceptionBuilder {
58 pub(crate) message: ::std::option::Option<::std::string::String>,
59 pub(crate) status: ::std::option::Option<::std::string::String>,
60 meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
61}
62impl VerificationExceptionBuilder {
63 #[allow(missing_docs)] pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66 self.message = ::std::option::Option::Some(input.into());
67 self
68 }
69 #[allow(missing_docs)] pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
71 self.message = input;
72 self
73 }
74 #[allow(missing_docs)] pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
76 &self.message
77 }
78 pub fn status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81 self.status = ::std::option::Option::Some(input.into());
82 self
83 }
84 pub fn set_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86 self.status = input;
87 self
88 }
89 pub fn get_status(&self) -> &::std::option::Option<::std::string::String> {
91 &self.status
92 }
93 pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
95 self.meta = Some(meta);
96 self
97 }
98
99 pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
101 self.meta = meta;
102 self
103 }
104 pub fn build(self) -> ::std::result::Result<crate::types::error::VerificationException, ::aws_smithy_types::error::operation::BuildError> {
109 ::std::result::Result::Ok(crate::types::error::VerificationException {
110 message: self.message.ok_or_else(|| {
111 ::aws_smithy_types::error::operation::BuildError::missing_field(
112 "message",
113 "message was not specified but it is required when building VerificationException",
114 )
115 })?,
116 status: self.status.ok_or_else(|| {
117 ::aws_smithy_types::error::operation::BuildError::missing_field(
118 "status",
119 "status was not specified but it is required when building VerificationException",
120 )
121 })?,
122 meta: self.meta.unwrap_or_default(),
123 })
124 }
125}