#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct FindLobbyError {
pub kind: FindLobbyErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum FindLobbyErrorKind {
InternalError(crate::error::InternalError),
RateLimitError(crate::error::RateLimitError),
ForbiddenError(crate::error::ForbiddenError),
UnauthorizedError(crate::error::UnauthorizedError),
NotFoundError(crate::error::NotFoundError),
BadRequestError(crate::error::BadRequestError),
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for FindLobbyError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
FindLobbyErrorKind::InternalError(_inner) => _inner.fmt(f),
FindLobbyErrorKind::RateLimitError(_inner) => _inner.fmt(f),
FindLobbyErrorKind::ForbiddenError(_inner) => _inner.fmt(f),
FindLobbyErrorKind::UnauthorizedError(_inner) => _inner.fmt(f),
FindLobbyErrorKind::NotFoundError(_inner) => _inner.fmt(f),
FindLobbyErrorKind::BadRequestError(_inner) => _inner.fmt(f),
FindLobbyErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for FindLobbyError {
fn code(&self) -> Option<&str> {
FindLobbyError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
match &self.kind {
FindLobbyErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()),
FindLobbyErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()),
_ => None,
}
}
}
impl FindLobbyError {
pub fn new(kind: FindLobbyErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: FindLobbyErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: FindLobbyErrorKind::Unhandled(err.into()),
}
}
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
pub fn is_internal_error(&self) -> bool {
matches!(&self.kind, FindLobbyErrorKind::InternalError(_))
}
pub fn is_rate_limit_error(&self) -> bool {
matches!(&self.kind, FindLobbyErrorKind::RateLimitError(_))
}
pub fn is_forbidden_error(&self) -> bool {
matches!(&self.kind, FindLobbyErrorKind::ForbiddenError(_))
}
pub fn is_unauthorized_error(&self) -> bool {
matches!(&self.kind, FindLobbyErrorKind::UnauthorizedError(_))
}
pub fn is_not_found_error(&self) -> bool {
matches!(&self.kind, FindLobbyErrorKind::NotFoundError(_))
}
pub fn is_bad_request_error(&self) -> bool {
matches!(&self.kind, FindLobbyErrorKind::BadRequestError(_))
}
}
impl std::error::Error for FindLobbyError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
FindLobbyErrorKind::InternalError(_inner) => Some(_inner),
FindLobbyErrorKind::RateLimitError(_inner) => Some(_inner),
FindLobbyErrorKind::ForbiddenError(_inner) => Some(_inner),
FindLobbyErrorKind::UnauthorizedError(_inner) => Some(_inner),
FindLobbyErrorKind::NotFoundError(_inner) => Some(_inner),
FindLobbyErrorKind::BadRequestError(_inner) => Some(_inner),
FindLobbyErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct JoinLobbyError {
pub kind: JoinLobbyErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum JoinLobbyErrorKind {
InternalError(crate::error::InternalError),
RateLimitError(crate::error::RateLimitError),
ForbiddenError(crate::error::ForbiddenError),
UnauthorizedError(crate::error::UnauthorizedError),
NotFoundError(crate::error::NotFoundError),
BadRequestError(crate::error::BadRequestError),
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for JoinLobbyError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
JoinLobbyErrorKind::InternalError(_inner) => _inner.fmt(f),
JoinLobbyErrorKind::RateLimitError(_inner) => _inner.fmt(f),
JoinLobbyErrorKind::ForbiddenError(_inner) => _inner.fmt(f),
JoinLobbyErrorKind::UnauthorizedError(_inner) => _inner.fmt(f),
JoinLobbyErrorKind::NotFoundError(_inner) => _inner.fmt(f),
JoinLobbyErrorKind::BadRequestError(_inner) => _inner.fmt(f),
JoinLobbyErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for JoinLobbyError {
fn code(&self) -> Option<&str> {
JoinLobbyError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
match &self.kind {
JoinLobbyErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()),
JoinLobbyErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()),
_ => None,
}
}
}
impl JoinLobbyError {
pub fn new(kind: JoinLobbyErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: JoinLobbyErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: JoinLobbyErrorKind::Unhandled(err.into()),
}
}
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
pub fn is_internal_error(&self) -> bool {
matches!(&self.kind, JoinLobbyErrorKind::InternalError(_))
}
pub fn is_rate_limit_error(&self) -> bool {
matches!(&self.kind, JoinLobbyErrorKind::RateLimitError(_))
}
pub fn is_forbidden_error(&self) -> bool {
matches!(&self.kind, JoinLobbyErrorKind::ForbiddenError(_))
}
pub fn is_unauthorized_error(&self) -> bool {
matches!(&self.kind, JoinLobbyErrorKind::UnauthorizedError(_))
}
pub fn is_not_found_error(&self) -> bool {
matches!(&self.kind, JoinLobbyErrorKind::NotFoundError(_))
}
pub fn is_bad_request_error(&self) -> bool {
matches!(&self.kind, JoinLobbyErrorKind::BadRequestError(_))
}
}
impl std::error::Error for JoinLobbyError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
JoinLobbyErrorKind::InternalError(_inner) => Some(_inner),
JoinLobbyErrorKind::RateLimitError(_inner) => Some(_inner),
JoinLobbyErrorKind::ForbiddenError(_inner) => Some(_inner),
JoinLobbyErrorKind::UnauthorizedError(_inner) => Some(_inner),
JoinLobbyErrorKind::NotFoundError(_inner) => Some(_inner),
JoinLobbyErrorKind::BadRequestError(_inner) => Some(_inner),
JoinLobbyErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListLobbiesError {
pub kind: ListLobbiesErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListLobbiesErrorKind {
InternalError(crate::error::InternalError),
RateLimitError(crate::error::RateLimitError),
ForbiddenError(crate::error::ForbiddenError),
UnauthorizedError(crate::error::UnauthorizedError),
NotFoundError(crate::error::NotFoundError),
BadRequestError(crate::error::BadRequestError),
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for ListLobbiesError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListLobbiesErrorKind::InternalError(_inner) => _inner.fmt(f),
ListLobbiesErrorKind::RateLimitError(_inner) => _inner.fmt(f),
ListLobbiesErrorKind::ForbiddenError(_inner) => _inner.fmt(f),
ListLobbiesErrorKind::UnauthorizedError(_inner) => _inner.fmt(f),
ListLobbiesErrorKind::NotFoundError(_inner) => _inner.fmt(f),
ListLobbiesErrorKind::BadRequestError(_inner) => _inner.fmt(f),
ListLobbiesErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListLobbiesError {
fn code(&self) -> Option<&str> {
ListLobbiesError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
match &self.kind {
ListLobbiesErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()),
ListLobbiesErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()),
_ => None,
}
}
}
impl ListLobbiesError {
pub fn new(kind: ListLobbiesErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: ListLobbiesErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListLobbiesErrorKind::Unhandled(err.into()),
}
}
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
pub fn is_internal_error(&self) -> bool {
matches!(&self.kind, ListLobbiesErrorKind::InternalError(_))
}
pub fn is_rate_limit_error(&self) -> bool {
matches!(&self.kind, ListLobbiesErrorKind::RateLimitError(_))
}
pub fn is_forbidden_error(&self) -> bool {
matches!(&self.kind, ListLobbiesErrorKind::ForbiddenError(_))
}
pub fn is_unauthorized_error(&self) -> bool {
matches!(&self.kind, ListLobbiesErrorKind::UnauthorizedError(_))
}
pub fn is_not_found_error(&self) -> bool {
matches!(&self.kind, ListLobbiesErrorKind::NotFoundError(_))
}
pub fn is_bad_request_error(&self) -> bool {
matches!(&self.kind, ListLobbiesErrorKind::BadRequestError(_))
}
}
impl std::error::Error for ListLobbiesError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListLobbiesErrorKind::InternalError(_inner) => Some(_inner),
ListLobbiesErrorKind::RateLimitError(_inner) => Some(_inner),
ListLobbiesErrorKind::ForbiddenError(_inner) => Some(_inner),
ListLobbiesErrorKind::UnauthorizedError(_inner) => Some(_inner),
ListLobbiesErrorKind::NotFoundError(_inner) => Some(_inner),
ListLobbiesErrorKind::BadRequestError(_inner) => Some(_inner),
ListLobbiesErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListRegionsError {
pub kind: ListRegionsErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListRegionsErrorKind {
InternalError(crate::error::InternalError),
RateLimitError(crate::error::RateLimitError),
ForbiddenError(crate::error::ForbiddenError),
UnauthorizedError(crate::error::UnauthorizedError),
NotFoundError(crate::error::NotFoundError),
BadRequestError(crate::error::BadRequestError),
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for ListRegionsError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListRegionsErrorKind::InternalError(_inner) => _inner.fmt(f),
ListRegionsErrorKind::RateLimitError(_inner) => _inner.fmt(f),
ListRegionsErrorKind::ForbiddenError(_inner) => _inner.fmt(f),
ListRegionsErrorKind::UnauthorizedError(_inner) => _inner.fmt(f),
ListRegionsErrorKind::NotFoundError(_inner) => _inner.fmt(f),
ListRegionsErrorKind::BadRequestError(_inner) => _inner.fmt(f),
ListRegionsErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListRegionsError {
fn code(&self) -> Option<&str> {
ListRegionsError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
match &self.kind {
ListRegionsErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()),
ListRegionsErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()),
_ => None,
}
}
}
impl ListRegionsError {
pub fn new(kind: ListRegionsErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: ListRegionsErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListRegionsErrorKind::Unhandled(err.into()),
}
}
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
pub fn is_internal_error(&self) -> bool {
matches!(&self.kind, ListRegionsErrorKind::InternalError(_))
}
pub fn is_rate_limit_error(&self) -> bool {
matches!(&self.kind, ListRegionsErrorKind::RateLimitError(_))
}
pub fn is_forbidden_error(&self) -> bool {
matches!(&self.kind, ListRegionsErrorKind::ForbiddenError(_))
}
pub fn is_unauthorized_error(&self) -> bool {
matches!(&self.kind, ListRegionsErrorKind::UnauthorizedError(_))
}
pub fn is_not_found_error(&self) -> bool {
matches!(&self.kind, ListRegionsErrorKind::NotFoundError(_))
}
pub fn is_bad_request_error(&self) -> bool {
matches!(&self.kind, ListRegionsErrorKind::BadRequestError(_))
}
}
impl std::error::Error for ListRegionsError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListRegionsErrorKind::InternalError(_inner) => Some(_inner),
ListRegionsErrorKind::RateLimitError(_inner) => Some(_inner),
ListRegionsErrorKind::ForbiddenError(_inner) => Some(_inner),
ListRegionsErrorKind::UnauthorizedError(_inner) => Some(_inner),
ListRegionsErrorKind::NotFoundError(_inner) => Some(_inner),
ListRegionsErrorKind::BadRequestError(_inner) => Some(_inner),
ListRegionsErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct LobbyReadyError {
pub kind: LobbyReadyErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum LobbyReadyErrorKind {
InternalError(crate::error::InternalError),
RateLimitError(crate::error::RateLimitError),
ForbiddenError(crate::error::ForbiddenError),
UnauthorizedError(crate::error::UnauthorizedError),
NotFoundError(crate::error::NotFoundError),
BadRequestError(crate::error::BadRequestError),
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for LobbyReadyError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
LobbyReadyErrorKind::InternalError(_inner) => _inner.fmt(f),
LobbyReadyErrorKind::RateLimitError(_inner) => _inner.fmt(f),
LobbyReadyErrorKind::ForbiddenError(_inner) => _inner.fmt(f),
LobbyReadyErrorKind::UnauthorizedError(_inner) => _inner.fmt(f),
LobbyReadyErrorKind::NotFoundError(_inner) => _inner.fmt(f),
LobbyReadyErrorKind::BadRequestError(_inner) => _inner.fmt(f),
LobbyReadyErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for LobbyReadyError {
fn code(&self) -> Option<&str> {
LobbyReadyError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
match &self.kind {
LobbyReadyErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()),
LobbyReadyErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()),
_ => None,
}
}
}
impl LobbyReadyError {
pub fn new(kind: LobbyReadyErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: LobbyReadyErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: LobbyReadyErrorKind::Unhandled(err.into()),
}
}
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
pub fn is_internal_error(&self) -> bool {
matches!(&self.kind, LobbyReadyErrorKind::InternalError(_))
}
pub fn is_rate_limit_error(&self) -> bool {
matches!(&self.kind, LobbyReadyErrorKind::RateLimitError(_))
}
pub fn is_forbidden_error(&self) -> bool {
matches!(&self.kind, LobbyReadyErrorKind::ForbiddenError(_))
}
pub fn is_unauthorized_error(&self) -> bool {
matches!(&self.kind, LobbyReadyErrorKind::UnauthorizedError(_))
}
pub fn is_not_found_error(&self) -> bool {
matches!(&self.kind, LobbyReadyErrorKind::NotFoundError(_))
}
pub fn is_bad_request_error(&self) -> bool {
matches!(&self.kind, LobbyReadyErrorKind::BadRequestError(_))
}
}
impl std::error::Error for LobbyReadyError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
LobbyReadyErrorKind::InternalError(_inner) => Some(_inner),
LobbyReadyErrorKind::RateLimitError(_inner) => Some(_inner),
LobbyReadyErrorKind::ForbiddenError(_inner) => Some(_inner),
LobbyReadyErrorKind::UnauthorizedError(_inner) => Some(_inner),
LobbyReadyErrorKind::NotFoundError(_inner) => Some(_inner),
LobbyReadyErrorKind::BadRequestError(_inner) => Some(_inner),
LobbyReadyErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct PlayerConnectedError {
pub kind: PlayerConnectedErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum PlayerConnectedErrorKind {
InternalError(crate::error::InternalError),
RateLimitError(crate::error::RateLimitError),
ForbiddenError(crate::error::ForbiddenError),
UnauthorizedError(crate::error::UnauthorizedError),
NotFoundError(crate::error::NotFoundError),
BadRequestError(crate::error::BadRequestError),
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for PlayerConnectedError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
PlayerConnectedErrorKind::InternalError(_inner) => _inner.fmt(f),
PlayerConnectedErrorKind::RateLimitError(_inner) => _inner.fmt(f),
PlayerConnectedErrorKind::ForbiddenError(_inner) => _inner.fmt(f),
PlayerConnectedErrorKind::UnauthorizedError(_inner) => _inner.fmt(f),
PlayerConnectedErrorKind::NotFoundError(_inner) => _inner.fmt(f),
PlayerConnectedErrorKind::BadRequestError(_inner) => _inner.fmt(f),
PlayerConnectedErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for PlayerConnectedError {
fn code(&self) -> Option<&str> {
PlayerConnectedError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
match &self.kind {
PlayerConnectedErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()),
PlayerConnectedErrorKind::UnauthorizedError(inner) => {
Some(inner.retryable_error_kind())
}
_ => None,
}
}
}
impl PlayerConnectedError {
pub fn new(kind: PlayerConnectedErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: PlayerConnectedErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: PlayerConnectedErrorKind::Unhandled(err.into()),
}
}
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
pub fn is_internal_error(&self) -> bool {
matches!(&self.kind, PlayerConnectedErrorKind::InternalError(_))
}
pub fn is_rate_limit_error(&self) -> bool {
matches!(&self.kind, PlayerConnectedErrorKind::RateLimitError(_))
}
pub fn is_forbidden_error(&self) -> bool {
matches!(&self.kind, PlayerConnectedErrorKind::ForbiddenError(_))
}
pub fn is_unauthorized_error(&self) -> bool {
matches!(&self.kind, PlayerConnectedErrorKind::UnauthorizedError(_))
}
pub fn is_not_found_error(&self) -> bool {
matches!(&self.kind, PlayerConnectedErrorKind::NotFoundError(_))
}
pub fn is_bad_request_error(&self) -> bool {
matches!(&self.kind, PlayerConnectedErrorKind::BadRequestError(_))
}
}
impl std::error::Error for PlayerConnectedError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
PlayerConnectedErrorKind::InternalError(_inner) => Some(_inner),
PlayerConnectedErrorKind::RateLimitError(_inner) => Some(_inner),
PlayerConnectedErrorKind::ForbiddenError(_inner) => Some(_inner),
PlayerConnectedErrorKind::UnauthorizedError(_inner) => Some(_inner),
PlayerConnectedErrorKind::NotFoundError(_inner) => Some(_inner),
PlayerConnectedErrorKind::BadRequestError(_inner) => Some(_inner),
PlayerConnectedErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct PlayerDisconnectedError {
pub kind: PlayerDisconnectedErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum PlayerDisconnectedErrorKind {
InternalError(crate::error::InternalError),
RateLimitError(crate::error::RateLimitError),
ForbiddenError(crate::error::ForbiddenError),
UnauthorizedError(crate::error::UnauthorizedError),
NotFoundError(crate::error::NotFoundError),
BadRequestError(crate::error::BadRequestError),
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for PlayerDisconnectedError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
PlayerDisconnectedErrorKind::InternalError(_inner) => _inner.fmt(f),
PlayerDisconnectedErrorKind::RateLimitError(_inner) => _inner.fmt(f),
PlayerDisconnectedErrorKind::ForbiddenError(_inner) => _inner.fmt(f),
PlayerDisconnectedErrorKind::UnauthorizedError(_inner) => _inner.fmt(f),
PlayerDisconnectedErrorKind::NotFoundError(_inner) => _inner.fmt(f),
PlayerDisconnectedErrorKind::BadRequestError(_inner) => _inner.fmt(f),
PlayerDisconnectedErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for PlayerDisconnectedError {
fn code(&self) -> Option<&str> {
PlayerDisconnectedError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
match &self.kind {
PlayerDisconnectedErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()),
PlayerDisconnectedErrorKind::UnauthorizedError(inner) => {
Some(inner.retryable_error_kind())
}
_ => None,
}
}
}
impl PlayerDisconnectedError {
pub fn new(kind: PlayerDisconnectedErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: PlayerDisconnectedErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: PlayerDisconnectedErrorKind::Unhandled(err.into()),
}
}
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
pub fn is_internal_error(&self) -> bool {
matches!(&self.kind, PlayerDisconnectedErrorKind::InternalError(_))
}
pub fn is_rate_limit_error(&self) -> bool {
matches!(&self.kind, PlayerDisconnectedErrorKind::RateLimitError(_))
}
pub fn is_forbidden_error(&self) -> bool {
matches!(&self.kind, PlayerDisconnectedErrorKind::ForbiddenError(_))
}
pub fn is_unauthorized_error(&self) -> bool {
matches!(
&self.kind,
PlayerDisconnectedErrorKind::UnauthorizedError(_)
)
}
pub fn is_not_found_error(&self) -> bool {
matches!(&self.kind, PlayerDisconnectedErrorKind::NotFoundError(_))
}
pub fn is_bad_request_error(&self) -> bool {
matches!(&self.kind, PlayerDisconnectedErrorKind::BadRequestError(_))
}
}
impl std::error::Error for PlayerDisconnectedError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
PlayerDisconnectedErrorKind::InternalError(_inner) => Some(_inner),
PlayerDisconnectedErrorKind::RateLimitError(_inner) => Some(_inner),
PlayerDisconnectedErrorKind::ForbiddenError(_inner) => Some(_inner),
PlayerDisconnectedErrorKind::UnauthorizedError(_inner) => Some(_inner),
PlayerDisconnectedErrorKind::NotFoundError(_inner) => Some(_inner),
PlayerDisconnectedErrorKind::BadRequestError(_inner) => Some(_inner),
PlayerDisconnectedErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct SetLobbyClosedError {
pub kind: SetLobbyClosedErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum SetLobbyClosedErrorKind {
InternalError(crate::error::InternalError),
RateLimitError(crate::error::RateLimitError),
ForbiddenError(crate::error::ForbiddenError),
UnauthorizedError(crate::error::UnauthorizedError),
NotFoundError(crate::error::NotFoundError),
BadRequestError(crate::error::BadRequestError),
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for SetLobbyClosedError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
SetLobbyClosedErrorKind::InternalError(_inner) => _inner.fmt(f),
SetLobbyClosedErrorKind::RateLimitError(_inner) => _inner.fmt(f),
SetLobbyClosedErrorKind::ForbiddenError(_inner) => _inner.fmt(f),
SetLobbyClosedErrorKind::UnauthorizedError(_inner) => _inner.fmt(f),
SetLobbyClosedErrorKind::NotFoundError(_inner) => _inner.fmt(f),
SetLobbyClosedErrorKind::BadRequestError(_inner) => _inner.fmt(f),
SetLobbyClosedErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for SetLobbyClosedError {
fn code(&self) -> Option<&str> {
SetLobbyClosedError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
match &self.kind {
SetLobbyClosedErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()),
SetLobbyClosedErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()),
_ => None,
}
}
}
impl SetLobbyClosedError {
pub fn new(kind: SetLobbyClosedErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: SetLobbyClosedErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: SetLobbyClosedErrorKind::Unhandled(err.into()),
}
}
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
pub fn is_internal_error(&self) -> bool {
matches!(&self.kind, SetLobbyClosedErrorKind::InternalError(_))
}
pub fn is_rate_limit_error(&self) -> bool {
matches!(&self.kind, SetLobbyClosedErrorKind::RateLimitError(_))
}
pub fn is_forbidden_error(&self) -> bool {
matches!(&self.kind, SetLobbyClosedErrorKind::ForbiddenError(_))
}
pub fn is_unauthorized_error(&self) -> bool {
matches!(&self.kind, SetLobbyClosedErrorKind::UnauthorizedError(_))
}
pub fn is_not_found_error(&self) -> bool {
matches!(&self.kind, SetLobbyClosedErrorKind::NotFoundError(_))
}
pub fn is_bad_request_error(&self) -> bool {
matches!(&self.kind, SetLobbyClosedErrorKind::BadRequestError(_))
}
}
impl std::error::Error for SetLobbyClosedError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
SetLobbyClosedErrorKind::InternalError(_inner) => Some(_inner),
SetLobbyClosedErrorKind::RateLimitError(_inner) => Some(_inner),
SetLobbyClosedErrorKind::ForbiddenError(_inner) => Some(_inner),
SetLobbyClosedErrorKind::UnauthorizedError(_inner) => Some(_inner),
SetLobbyClosedErrorKind::NotFoundError(_inner) => Some(_inner),
SetLobbyClosedErrorKind::BadRequestError(_inner) => Some(_inner),
SetLobbyClosedErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct BadRequestError {
#[allow(missing_docs)] pub code: std::option::Option<std::string::String>,
#[allow(missing_docs)] pub message: std::option::Option<std::string::String>,
pub metadata: std::option::Option<aws_smithy_types::Document>,
}
impl BadRequestError {
#[allow(missing_docs)] pub fn code(&self) -> std::option::Option<&str> {
self.code.as_deref()
}
pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> {
self.metadata.as_ref()
}
}
impl std::fmt::Debug for BadRequestError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("BadRequestError");
formatter.field("code", &self.code);
formatter.field("message", &self.message);
formatter.field("metadata", &self.metadata);
formatter.finish()
}
}
impl BadRequestError {
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for BadRequestError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "BadRequestError")?;
if let Some(inner_1) = &self.message {
write!(f, ": {}", inner_1)?;
}
Ok(())
}
}
impl std::error::Error for BadRequestError {}
pub mod bad_request_error {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) code: std::option::Option<std::string::String>,
pub(crate) message: std::option::Option<std::string::String>,
pub(crate) metadata: std::option::Option<aws_smithy_types::Document>,
}
impl Builder {
#[allow(missing_docs)] pub fn code(mut self, input: impl Into<std::string::String>) -> Self {
self.code = Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_code(mut self, input: std::option::Option<std::string::String>) -> Self {
self.code = input;
self
}
#[allow(missing_docs)] pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = 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
}
pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self {
self.metadata = Some(input);
self
}
pub fn set_metadata(
mut self,
input: std::option::Option<aws_smithy_types::Document>,
) -> Self {
self.metadata = input;
self
}
pub fn build(self) -> crate::error::BadRequestError {
crate::error::BadRequestError {
code: self.code,
message: self.message,
metadata: self.metadata,
}
}
}
}
impl BadRequestError {
pub fn builder() -> crate::error::bad_request_error::Builder {
crate::error::bad_request_error::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct NotFoundError {
#[allow(missing_docs)] pub code: std::option::Option<std::string::String>,
#[allow(missing_docs)] pub message: std::option::Option<std::string::String>,
pub metadata: std::option::Option<aws_smithy_types::Document>,
}
impl NotFoundError {
#[allow(missing_docs)] pub fn code(&self) -> std::option::Option<&str> {
self.code.as_deref()
}
pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> {
self.metadata.as_ref()
}
}
impl std::fmt::Debug for NotFoundError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("NotFoundError");
formatter.field("code", &self.code);
formatter.field("message", &self.message);
formatter.field("metadata", &self.metadata);
formatter.finish()
}
}
impl NotFoundError {
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for NotFoundError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "NotFoundError")?;
if let Some(inner_2) = &self.message {
write!(f, ": {}", inner_2)?;
}
Ok(())
}
}
impl std::error::Error for NotFoundError {}
pub mod not_found_error {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) code: std::option::Option<std::string::String>,
pub(crate) message: std::option::Option<std::string::String>,
pub(crate) metadata: std::option::Option<aws_smithy_types::Document>,
}
impl Builder {
#[allow(missing_docs)] pub fn code(mut self, input: impl Into<std::string::String>) -> Self {
self.code = Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_code(mut self, input: std::option::Option<std::string::String>) -> Self {
self.code = input;
self
}
#[allow(missing_docs)] pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = 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
}
pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self {
self.metadata = Some(input);
self
}
pub fn set_metadata(
mut self,
input: std::option::Option<aws_smithy_types::Document>,
) -> Self {
self.metadata = input;
self
}
pub fn build(self) -> crate::error::NotFoundError {
crate::error::NotFoundError {
code: self.code,
message: self.message,
metadata: self.metadata,
}
}
}
}
impl NotFoundError {
pub fn builder() -> crate::error::not_found_error::Builder {
crate::error::not_found_error::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct UnauthorizedError {
#[allow(missing_docs)] pub code: std::option::Option<std::string::String>,
#[allow(missing_docs)] pub message: std::option::Option<std::string::String>,
pub metadata: std::option::Option<aws_smithy_types::Document>,
}
impl UnauthorizedError {
#[allow(missing_docs)] pub fn code(&self) -> std::option::Option<&str> {
self.code.as_deref()
}
pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> {
self.metadata.as_ref()
}
}
impl std::fmt::Debug for UnauthorizedError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("UnauthorizedError");
formatter.field("code", &self.code);
formatter.field("message", &self.message);
formatter.field("metadata", &self.metadata);
formatter.finish()
}
}
impl UnauthorizedError {
pub fn retryable_error_kind(&self) -> aws_smithy_types::retry::ErrorKind {
aws_smithy_types::retry::ErrorKind::ClientError
}
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for UnauthorizedError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "UnauthorizedError")?;
if let Some(inner_3) = &self.message {
write!(f, ": {}", inner_3)?;
}
Ok(())
}
}
impl std::error::Error for UnauthorizedError {}
pub mod unauthorized_error {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) code: std::option::Option<std::string::String>,
pub(crate) message: std::option::Option<std::string::String>,
pub(crate) metadata: std::option::Option<aws_smithy_types::Document>,
}
impl Builder {
#[allow(missing_docs)] pub fn code(mut self, input: impl Into<std::string::String>) -> Self {
self.code = Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_code(mut self, input: std::option::Option<std::string::String>) -> Self {
self.code = input;
self
}
#[allow(missing_docs)] pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = 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
}
pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self {
self.metadata = Some(input);
self
}
pub fn set_metadata(
mut self,
input: std::option::Option<aws_smithy_types::Document>,
) -> Self {
self.metadata = input;
self
}
pub fn build(self) -> crate::error::UnauthorizedError {
crate::error::UnauthorizedError {
code: self.code,
message: self.message,
metadata: self.metadata,
}
}
}
}
impl UnauthorizedError {
pub fn builder() -> crate::error::unauthorized_error::Builder {
crate::error::unauthorized_error::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ForbiddenError {
#[allow(missing_docs)] pub code: std::option::Option<std::string::String>,
#[allow(missing_docs)] pub message: std::option::Option<std::string::String>,
pub metadata: std::option::Option<aws_smithy_types::Document>,
}
impl ForbiddenError {
#[allow(missing_docs)] pub fn code(&self) -> std::option::Option<&str> {
self.code.as_deref()
}
pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> {
self.metadata.as_ref()
}
}
impl std::fmt::Debug for ForbiddenError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ForbiddenError");
formatter.field("code", &self.code);
formatter.field("message", &self.message);
formatter.field("metadata", &self.metadata);
formatter.finish()
}
}
impl ForbiddenError {
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for ForbiddenError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "ForbiddenError")?;
if let Some(inner_4) = &self.message {
write!(f, ": {}", inner_4)?;
}
Ok(())
}
}
impl std::error::Error for ForbiddenError {}
pub mod forbidden_error {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) code: std::option::Option<std::string::String>,
pub(crate) message: std::option::Option<std::string::String>,
pub(crate) metadata: std::option::Option<aws_smithy_types::Document>,
}
impl Builder {
#[allow(missing_docs)] pub fn code(mut self, input: impl Into<std::string::String>) -> Self {
self.code = Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_code(mut self, input: std::option::Option<std::string::String>) -> Self {
self.code = input;
self
}
#[allow(missing_docs)] pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = 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
}
pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self {
self.metadata = Some(input);
self
}
pub fn set_metadata(
mut self,
input: std::option::Option<aws_smithy_types::Document>,
) -> Self {
self.metadata = input;
self
}
pub fn build(self) -> crate::error::ForbiddenError {
crate::error::ForbiddenError {
code: self.code,
message: self.message,
metadata: self.metadata,
}
}
}
}
impl ForbiddenError {
pub fn builder() -> crate::error::forbidden_error::Builder {
crate::error::forbidden_error::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct RateLimitError {
#[allow(missing_docs)] pub code: std::option::Option<std::string::String>,
#[allow(missing_docs)] pub message: std::option::Option<std::string::String>,
pub metadata: std::option::Option<aws_smithy_types::Document>,
}
impl RateLimitError {
#[allow(missing_docs)] pub fn code(&self) -> std::option::Option<&str> {
self.code.as_deref()
}
pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> {
self.metadata.as_ref()
}
}
impl std::fmt::Debug for RateLimitError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("RateLimitError");
formatter.field("code", &self.code);
formatter.field("message", &self.message);
formatter.field("metadata", &self.metadata);
formatter.finish()
}
}
impl RateLimitError {
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for RateLimitError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "RateLimitError")?;
if let Some(inner_5) = &self.message {
write!(f, ": {}", inner_5)?;
}
Ok(())
}
}
impl std::error::Error for RateLimitError {}
pub mod rate_limit_error {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) code: std::option::Option<std::string::String>,
pub(crate) message: std::option::Option<std::string::String>,
pub(crate) metadata: std::option::Option<aws_smithy_types::Document>,
}
impl Builder {
#[allow(missing_docs)] pub fn code(mut self, input: impl Into<std::string::String>) -> Self {
self.code = Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_code(mut self, input: std::option::Option<std::string::String>) -> Self {
self.code = input;
self
}
#[allow(missing_docs)] pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = 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
}
pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self {
self.metadata = Some(input);
self
}
pub fn set_metadata(
mut self,
input: std::option::Option<aws_smithy_types::Document>,
) -> Self {
self.metadata = input;
self
}
pub fn build(self) -> crate::error::RateLimitError {
crate::error::RateLimitError {
code: self.code,
message: self.message,
metadata: self.metadata,
}
}
}
}
impl RateLimitError {
pub fn builder() -> crate::error::rate_limit_error::Builder {
crate::error::rate_limit_error::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct InternalError {
#[allow(missing_docs)] pub code: std::option::Option<std::string::String>,
#[allow(missing_docs)] pub message: std::option::Option<std::string::String>,
pub metadata: std::option::Option<aws_smithy_types::Document>,
}
impl InternalError {
#[allow(missing_docs)] pub fn code(&self) -> std::option::Option<&str> {
self.code.as_deref()
}
pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> {
self.metadata.as_ref()
}
}
impl std::fmt::Debug for InternalError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("InternalError");
formatter.field("code", &self.code);
formatter.field("message", &self.message);
formatter.field("metadata", &self.metadata);
formatter.finish()
}
}
impl InternalError {
pub fn retryable_error_kind(&self) -> aws_smithy_types::retry::ErrorKind {
aws_smithy_types::retry::ErrorKind::ServerError
}
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for InternalError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "InternalError")?;
if let Some(inner_6) = &self.message {
write!(f, ": {}", inner_6)?;
}
Ok(())
}
}
impl std::error::Error for InternalError {}
pub mod internal_error {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) code: std::option::Option<std::string::String>,
pub(crate) message: std::option::Option<std::string::String>,
pub(crate) metadata: std::option::Option<aws_smithy_types::Document>,
}
impl Builder {
#[allow(missing_docs)] pub fn code(mut self, input: impl Into<std::string::String>) -> Self {
self.code = Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_code(mut self, input: std::option::Option<std::string::String>) -> Self {
self.code = input;
self
}
#[allow(missing_docs)] pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = 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
}
pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self {
self.metadata = Some(input);
self
}
pub fn set_metadata(
mut self,
input: std::option::Option<aws_smithy_types::Document>,
) -> Self {
self.metadata = input;
self
}
pub fn build(self) -> crate::error::InternalError {
crate::error::InternalError {
code: self.code,
message: self.message,
metadata: self.metadata,
}
}
}
}
impl InternalError {
pub fn builder() -> crate::error::internal_error::Builder {
crate::error::internal_error::Builder::default()
}
}