aws_sdk_appfabric/types/error/
_internal_server_exception.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct InternalServerException {
7 #[allow(missing_docs)] pub message: ::std::string::String,
9 pub retry_after_seconds: ::std::option::Option<i32>,
11 pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
12}
13impl InternalServerException {
14 pub fn retry_after_seconds(&self) -> ::std::option::Option<i32> {
16 self.retry_after_seconds
17 }
18}
19impl InternalServerException {
20 pub fn retryable_error_kind(&self) -> ::aws_smithy_types::retry::ErrorKind {
22 ::aws_smithy_types::retry::ErrorKind::ServerError
23 }
24 pub fn message(&self) -> &str {
26 &self.message
27 }
28}
29impl ::std::fmt::Display for InternalServerException {
30 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
31 ::std::write!(f, "InternalServerException")?;
32 {
33 ::std::write!(f, ": {}", &self.message)?;
34 }
35 Ok(())
36 }
37}
38impl ::std::error::Error for InternalServerException {}
39impl ::aws_types::request_id::RequestId for crate::types::error::InternalServerException {
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 InternalServerException {
46 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
47 &self.meta
48 }
49}
50impl InternalServerException {
51 pub fn builder() -> crate::types::error::builders::InternalServerExceptionBuilder {
53 crate::types::error::builders::InternalServerExceptionBuilder::default()
54 }
55}
56
57#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
59#[non_exhaustive]
60pub struct InternalServerExceptionBuilder {
61 pub(crate) message: ::std::option::Option<::std::string::String>,
62 pub(crate) retry_after_seconds: ::std::option::Option<i32>,
63 meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
64}
65impl InternalServerExceptionBuilder {
66 #[allow(missing_docs)] pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69 self.message = ::std::option::Option::Some(input.into());
70 self
71 }
72 #[allow(missing_docs)] pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74 self.message = input;
75 self
76 }
77 #[allow(missing_docs)] pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
79 &self.message
80 }
81 pub fn retry_after_seconds(mut self, input: i32) -> Self {
83 self.retry_after_seconds = ::std::option::Option::Some(input);
84 self
85 }
86 pub fn set_retry_after_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
88 self.retry_after_seconds = input;
89 self
90 }
91 pub fn get_retry_after_seconds(&self) -> &::std::option::Option<i32> {
93 &self.retry_after_seconds
94 }
95 pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
97 self.meta = Some(meta);
98 self
99 }
100
101 pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
103 self.meta = meta;
104 self
105 }
106 pub fn build(self) -> ::std::result::Result<crate::types::error::InternalServerException, ::aws_smithy_types::error::operation::BuildError> {
110 ::std::result::Result::Ok(crate::types::error::InternalServerException {
111 message: self.message.ok_or_else(|| {
112 ::aws_smithy_types::error::operation::BuildError::missing_field(
113 "message",
114 "message was not specified but it is required when building InternalServerException",
115 )
116 })?,
117 retry_after_seconds: self.retry_after_seconds,
118 meta: self.meta.unwrap_or_default(),
119 })
120 }
121}