#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ThrottlingException {
#[allow(missing_docs)] pub message: ::std::string::String,
pub retry_after_seconds: ::std::option::Option<i32>,
pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
}
impl ThrottlingException {
pub fn retry_after_seconds(&self) -> ::std::option::Option<i32> {
self.retry_after_seconds
}
}
impl ThrottlingException {
pub fn message(&self) -> &str {
&self.message
}
}
impl ::std::fmt::Display for ThrottlingException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
::std::write!(f, "ThrottlingException")?;
{
::std::write!(f, ": {}", &self.message)?;
}
Ok(())
}
}
impl ::std::error::Error for ThrottlingException {}
impl ::aws_types::request_id::RequestId for crate::types::error::ThrottlingException {
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 ThrottlingException {
fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
&self.meta
}
}
impl ThrottlingException {
pub fn builder() -> crate::types::error::builders::ThrottlingExceptionBuilder {
crate::types::error::builders::ThrottlingExceptionBuilder::default()
}
}
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ThrottlingExceptionBuilder {
pub(crate) message: ::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 ThrottlingExceptionBuilder {
#[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 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) -> ::std::result::Result<crate::types::error::ThrottlingException, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::error::ThrottlingException {
message: self.message.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"message",
"message was not specified but it is required when building ThrottlingException",
)
})?,
retry_after_seconds: self.retry_after_seconds,
meta: self.meta.unwrap_or_default(),
})
}
}