#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct InternalServerException {
#[allow(missing_docs)] pub message: ::std::option::Option<::std::string::String>,
pub request_id: ::std::option::Option<::std::string::String>,
pub retry_after_seconds: i32,
pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
}
impl InternalServerException {
pub fn request_id(&self) -> ::std::option::Option<&str> {
self.request_id.as_deref()
}
pub fn retry_after_seconds(&self) -> i32 {
self.retry_after_seconds
}
}
impl InternalServerException {
pub fn retryable_error_kind(&self) -> ::aws_smithy_types::retry::ErrorKind {
::aws_smithy_types::retry::ErrorKind::ServerError
}
pub fn message(&self) -> ::std::option::Option<&str> {
self.message.as_deref()
}
}
impl ::std::fmt::Display for InternalServerException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
::std::write!(f, "InternalServerException")?;
if let ::std::option::Option::Some(inner_1) = &self.message {
{
::std::write!(f, ": {}", inner_1)?;
}
}
Ok(())
}
}
impl ::std::error::Error for InternalServerException {}
impl ::aws_types::request_id::RequestId for crate::types::error::InternalServerException {
fn request_id(&self) -> Option<&str> {
use ::aws_smithy_types::error::metadata::ProvideErrorMetadata;
self.meta().request_id()
}
}
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for InternalServerException {
fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
&self.meta
}
}
impl InternalServerException {
pub fn builder() -> crate::types::error::builders::InternalServerExceptionBuilder {
crate::types::error::builders::InternalServerExceptionBuilder::default()
}
}
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct InternalServerExceptionBuilder {
pub(crate) message: ::std::option::Option<::std::string::String>,
pub(crate) request_id: ::std::option::Option<::std::string::String>,
pub(crate) retry_after_seconds: ::std::option::Option<i32>,
meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
}
impl InternalServerExceptionBuilder {
#[allow(missing_docs)] pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.message = ::std::option::Option::Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.message = input;
self
}
#[allow(missing_docs)] pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
&self.message
}
pub fn request_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.request_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_request_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.request_id = input;
self
}
pub fn get_request_id(&self) -> &::std::option::Option<::std::string::String> {
&self.request_id
}
pub fn retry_after_seconds(mut self, input: i32) -> Self {
self.retry_after_seconds = ::std::option::Option::Some(input);
self
}
pub fn set_retry_after_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
self.retry_after_seconds = input;
self
}
pub fn get_retry_after_seconds(&self) -> &::std::option::Option<i32> {
&self.retry_after_seconds
}
pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
self.meta = Some(meta);
self
}
pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
self.meta = meta;
self
}
pub fn build(self) -> crate::types::error::InternalServerException {
crate::types::error::InternalServerException {
message: self.message,
request_id: self.request_id,
retry_after_seconds: self.retry_after_seconds.unwrap_or_default(),
meta: self.meta.unwrap_or_default(),
}
}
}