aws_sdk_geomaps/types/error/
_access_denied_exception.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct AccessDeniedException {
7 #[allow(missing_docs)] pub message: ::std::string::String,
9 pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
10}
11impl AccessDeniedException {
12 pub fn message(&self) -> &str {
14 &self.message
15 }
16}
17impl ::std::fmt::Display for AccessDeniedException {
18 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19 ::std::write!(f, "AccessDeniedException")?;
20 {
21 ::std::write!(f, ": {}", &self.message)?;
22 }
23 Ok(())
24 }
25}
26impl ::std::error::Error for AccessDeniedException {}
27impl ::aws_types::request_id::RequestId for crate::types::error::AccessDeniedException {
28 fn request_id(&self) -> Option<&str> {
29 use ::aws_smithy_types::error::metadata::ProvideErrorMetadata;
30 self.meta().request_id()
31 }
32}
33impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for AccessDeniedException {
34 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
35 &self.meta
36 }
37}
38impl AccessDeniedException {
39 pub fn builder() -> crate::types::error::builders::AccessDeniedExceptionBuilder {
41 crate::types::error::builders::AccessDeniedExceptionBuilder::default()
42 }
43}
44
45#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
47#[non_exhaustive]
48pub struct AccessDeniedExceptionBuilder {
49 pub(crate) message: ::std::option::Option<::std::string::String>,
50 meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
51}
52impl AccessDeniedExceptionBuilder {
53 #[allow(missing_docs)] pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
56 self.message = ::std::option::Option::Some(input.into());
57 self
58 }
59 #[allow(missing_docs)] pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
61 self.message = input;
62 self
63 }
64 #[allow(missing_docs)] pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
66 &self.message
67 }
68 pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
70 self.meta = Some(meta);
71 self
72 }
73
74 pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
76 self.meta = meta;
77 self
78 }
79 pub fn build(self) -> ::std::result::Result<crate::types::error::AccessDeniedException, ::aws_smithy_types::error::operation::BuildError> {
83 ::std::result::Result::Ok(crate::types::error::AccessDeniedException {
84 message: self.message.ok_or_else(|| {
85 ::aws_smithy_types::error::operation::BuildError::missing_field(
86 "message",
87 "message was not specified but it is required when building AccessDeniedException",
88 )
89 })?,
90 meta: self.meta.unwrap_or_default(),
91 })
92 }
93}