aws_sdk_efs/types/error/
_access_point_already_exists.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct AccessPointAlreadyExists {
7 pub error_code: ::std::string::String,
9 pub message: ::std::option::Option<::std::string::String>,
11 #[allow(missing_docs)] pub access_point_id: ::std::string::String,
13 pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
14}
15impl AccessPointAlreadyExists {
16 pub fn error_code(&self) -> &str {
18 use std::ops::Deref;
19 self.error_code.deref()
20 }
21 #[allow(missing_docs)] pub fn access_point_id(&self) -> &str {
23 use std::ops::Deref;
24 self.access_point_id.deref()
25 }
26}
27impl AccessPointAlreadyExists {
28 pub fn message(&self) -> ::std::option::Option<&str> {
30 self.message.as_deref()
31 }
32}
33impl ::std::fmt::Display for AccessPointAlreadyExists {
34 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
35 ::std::write!(f, "AccessPointAlreadyExists")?;
36 if let ::std::option::Option::Some(inner_1) = &self.message {
37 {
38 ::std::write!(f, ": {inner_1}")?;
39 }
40 }
41 Ok(())
42 }
43}
44impl ::std::error::Error for AccessPointAlreadyExists {}
45impl ::aws_types::request_id::RequestId for crate::types::error::AccessPointAlreadyExists {
46 fn request_id(&self) -> Option<&str> {
47 use ::aws_smithy_types::error::metadata::ProvideErrorMetadata;
48 self.meta().request_id()
49 }
50}
51impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for AccessPointAlreadyExists {
52 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
53 &self.meta
54 }
55}
56impl AccessPointAlreadyExists {
57 pub fn builder() -> crate::types::error::builders::AccessPointAlreadyExistsBuilder {
59 crate::types::error::builders::AccessPointAlreadyExistsBuilder::default()
60 }
61}
62
63#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
65#[non_exhaustive]
66pub struct AccessPointAlreadyExistsBuilder {
67 pub(crate) error_code: ::std::option::Option<::std::string::String>,
68 pub(crate) message: ::std::option::Option<::std::string::String>,
69 pub(crate) access_point_id: ::std::option::Option<::std::string::String>,
70 meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
71}
72impl AccessPointAlreadyExistsBuilder {
73 pub fn error_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76 self.error_code = ::std::option::Option::Some(input.into());
77 self
78 }
79 pub fn set_error_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81 self.error_code = input;
82 self
83 }
84 pub fn get_error_code(&self) -> &::std::option::Option<::std::string::String> {
86 &self.error_code
87 }
88 pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
90 self.message = ::std::option::Option::Some(input.into());
91 self
92 }
93 pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
95 self.message = input;
96 self
97 }
98 pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
100 &self.message
101 }
102 #[allow(missing_docs)] pub fn access_point_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105 self.access_point_id = ::std::option::Option::Some(input.into());
106 self
107 }
108 #[allow(missing_docs)] pub fn set_access_point_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110 self.access_point_id = input;
111 self
112 }
113 #[allow(missing_docs)] pub fn get_access_point_id(&self) -> &::std::option::Option<::std::string::String> {
115 &self.access_point_id
116 }
117 pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
119 self.meta = Some(meta);
120 self
121 }
122
123 pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
125 self.meta = meta;
126 self
127 }
128 pub fn build(self) -> ::std::result::Result<crate::types::error::AccessPointAlreadyExists, ::aws_smithy_types::error::operation::BuildError> {
133 ::std::result::Result::Ok(crate::types::error::AccessPointAlreadyExists {
134 error_code: self.error_code.ok_or_else(|| {
135 ::aws_smithy_types::error::operation::BuildError::missing_field(
136 "error_code",
137 "error_code was not specified but it is required when building AccessPointAlreadyExists",
138 )
139 })?,
140 message: self.message,
141 access_point_id: self.access_point_id.ok_or_else(|| {
142 ::aws_smithy_types::error::operation::BuildError::missing_field(
143 "access_point_id",
144 "access_point_id was not specified but it is required when building AccessPointAlreadyExists",
145 )
146 })?,
147 meta: self.meta.unwrap_or_default(),
148 })
149 }
150}