// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Indicates that the principal has crossed the throttling limits of the API operations.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ThrottlingException {
#[allow(missing_docs)] // documentation missing in model
#[doc(hidden)]
pub message: std::option::Option<std::string::String>,
/// <p>The identifier for each request. This value is a globally unique ID that is generated by the identity store service for each sent request, and is then returned inside the exception if the request fails.</p>
#[doc(hidden)]
pub request_id: std::option::Option<std::string::String>,
/// <p>The number of seconds that you would like to wait before retrying the next request.</p>
#[doc(hidden)]
pub retry_after_seconds: i32,
}
impl ThrottlingException {
/// <p>The identifier for each request. This value is a globally unique ID that is generated by the identity store service for each sent request, and is then returned inside the exception if the request fails.</p>
pub fn request_id(&self) -> std::option::Option<&str> {
self.request_id.as_deref()
}
/// <p>The number of seconds that you would like to wait before retrying the next request.</p>
pub fn retry_after_seconds(&self) -> i32 {
self.retry_after_seconds
}
}
impl ThrottlingException {
/// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`.
pub fn retryable_error_kind(&self) -> aws_smithy_types::retry::ErrorKind {
aws_smithy_types::retry::ErrorKind::ThrottlingError
}
/// Returns the error message.
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for ThrottlingException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "ThrottlingException")?;
if let Some(inner_1) = &self.message {
{
write!(f, ": {}", inner_1)?;
}
}
Ok(())
}
}
impl std::error::Error for ThrottlingException {}
/// See [`ThrottlingException`](crate::error::ThrottlingException).
pub mod throttling_exception {
/// A builder for [`ThrottlingException`](crate::error::ThrottlingException).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
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>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// <p>The identifier for each request. This value is a globally unique ID that is generated by the identity store service for each sent request, and is then returned inside the exception if the request fails.</p>
pub fn request_id(mut self, input: impl Into<std::string::String>) -> Self {
self.request_id = Some(input.into());
self
}
/// <p>The identifier for each request. This value is a globally unique ID that is generated by the identity store service for each sent request, and is then returned inside the exception if the request fails.</p>
pub fn set_request_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.request_id = input;
self
}
/// <p>The number of seconds that you would like to wait before retrying the next request.</p>
pub fn retry_after_seconds(mut self, input: i32) -> Self {
self.retry_after_seconds = Some(input);
self
}
/// <p>The number of seconds that you would like to wait before retrying the next request.</p>
pub fn set_retry_after_seconds(mut self, input: std::option::Option<i32>) -> Self {
self.retry_after_seconds = input;
self
}
/// Consumes the builder and constructs a [`ThrottlingException`](crate::error::ThrottlingException).
pub fn build(self) -> crate::error::ThrottlingException {
crate::error::ThrottlingException {
message: self.message,
request_id: self.request_id,
retry_after_seconds: self.retry_after_seconds.unwrap_or_default(),
}
}
}
}
impl ThrottlingException {
/// Creates a new builder-style object to manufacture [`ThrottlingException`](crate::error::ThrottlingException).
pub fn builder() -> crate::error::throttling_exception::Builder {
crate::error::throttling_exception::Builder::default()
}
}
/// <p>The request processing has failed because of an unknown error, exception or failure with an internal server.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct InternalServerException {
#[allow(missing_docs)] // documentation missing in model
#[doc(hidden)]
pub message: std::option::Option<std::string::String>,
/// <p>The identifier for each request. This value is a globally unique ID that is generated by the identity store service for each sent request, and is then returned inside the exception if the request fails.</p>
#[doc(hidden)]
pub request_id: std::option::Option<std::string::String>,
/// <p>The number of seconds that you would like to wait before retrying the next request.</p>
#[doc(hidden)]
pub retry_after_seconds: i32,
}
impl InternalServerException {
/// <p>The identifier for each request. This value is a globally unique ID that is generated by the identity store service for each sent request, and is then returned inside the exception if the request fails.</p>
pub fn request_id(&self) -> std::option::Option<&str> {
self.request_id.as_deref()
}
/// <p>The number of seconds that you would like to wait before retrying the next request.</p>
pub fn retry_after_seconds(&self) -> i32 {
self.retry_after_seconds
}
}
impl InternalServerException {
/// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`.
pub fn retryable_error_kind(&self) -> aws_smithy_types::retry::ErrorKind {
aws_smithy_types::retry::ErrorKind::ServerError
}
/// Returns the error message.
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 {
write!(f, "InternalServerException")?;
if let Some(inner_2) = &self.message {
{
write!(f, ": {}", inner_2)?;
}
}
Ok(())
}
}
impl std::error::Error for InternalServerException {}
/// See [`InternalServerException`](crate::error::InternalServerException).
pub mod internal_server_exception {
/// A builder for [`InternalServerException`](crate::error::InternalServerException).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
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>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// <p>The identifier for each request. This value is a globally unique ID that is generated by the identity store service for each sent request, and is then returned inside the exception if the request fails.</p>
pub fn request_id(mut self, input: impl Into<std::string::String>) -> Self {
self.request_id = Some(input.into());
self
}
/// <p>The identifier for each request. This value is a globally unique ID that is generated by the identity store service for each sent request, and is then returned inside the exception if the request fails.</p>
pub fn set_request_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.request_id = input;
self
}
/// <p>The number of seconds that you would like to wait before retrying the next request.</p>
pub fn retry_after_seconds(mut self, input: i32) -> Self {
self.retry_after_seconds = Some(input);
self
}
/// <p>The number of seconds that you would like to wait before retrying the next request.</p>
pub fn set_retry_after_seconds(mut self, input: std::option::Option<i32>) -> Self {
self.retry_after_seconds = input;
self
}
/// Consumes the builder and constructs a [`InternalServerException`](crate::error::InternalServerException).
pub fn build(self) -> crate::error::InternalServerException {
crate::error::InternalServerException {
message: self.message,
request_id: self.request_id,
retry_after_seconds: self.retry_after_seconds.unwrap_or_default(),
}
}
}
}
impl InternalServerException {
/// Creates a new builder-style object to manufacture [`InternalServerException`](crate::error::InternalServerException).
pub fn builder() -> crate::error::internal_server_exception::Builder {
crate::error::internal_server_exception::Builder::default()
}
}
/// <p>You do not have sufficient access to perform this action.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct AccessDeniedException {
#[allow(missing_docs)] // documentation missing in model
#[doc(hidden)]
pub message: std::option::Option<std::string::String>,
/// <p>The identifier for each request. This value is a globally unique ID that is generated by the identity store service for each sent request, and is then returned inside the exception if the request fails.</p>
#[doc(hidden)]
pub request_id: std::option::Option<std::string::String>,
}
impl AccessDeniedException {
/// <p>The identifier for each request. This value is a globally unique ID that is generated by the identity store service for each sent request, and is then returned inside the exception if the request fails.</p>
pub fn request_id(&self) -> std::option::Option<&str> {
self.request_id.as_deref()
}
}
impl AccessDeniedException {
/// Returns the error message.
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for AccessDeniedException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "AccessDeniedException")?;
if let Some(inner_3) = &self.message {
{
write!(f, ": {}", inner_3)?;
}
}
Ok(())
}
}
impl std::error::Error for AccessDeniedException {}
/// See [`AccessDeniedException`](crate::error::AccessDeniedException).
pub mod access_denied_exception {
/// A builder for [`AccessDeniedException`](crate::error::AccessDeniedException).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
pub(crate) request_id: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// <p>The identifier for each request. This value is a globally unique ID that is generated by the identity store service for each sent request, and is then returned inside the exception if the request fails.</p>
pub fn request_id(mut self, input: impl Into<std::string::String>) -> Self {
self.request_id = Some(input.into());
self
}
/// <p>The identifier for each request. This value is a globally unique ID that is generated by the identity store service for each sent request, and is then returned inside the exception if the request fails.</p>
pub fn set_request_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.request_id = input;
self
}
/// Consumes the builder and constructs a [`AccessDeniedException`](crate::error::AccessDeniedException).
pub fn build(self) -> crate::error::AccessDeniedException {
crate::error::AccessDeniedException {
message: self.message,
request_id: self.request_id,
}
}
}
}
impl AccessDeniedException {
/// Creates a new builder-style object to manufacture [`AccessDeniedException`](crate::error::AccessDeniedException).
pub fn builder() -> crate::error::access_denied_exception::Builder {
crate::error::access_denied_exception::Builder::default()
}
}
/// Error type for the `ListUsers` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListUsersError {
/// Kind of error that occurred.
pub kind: ListUsersErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for ListUsersError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: ListUsersErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
/// Types of errors that can occur for the `ListUsers` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListUsersErrorKind {
/// <p>Indicates that a requested resource is not found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>The request failed because it contains a syntax error.</p>
ValidationException(crate::error::ValidationException),
/// <p>You do not have sufficient access to perform this action.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>The request processing has failed because of an unknown error, exception or failure with an internal server.</p>
InternalServerException(crate::error::InternalServerException),
/// <p>Indicates that the principal has crossed the throttling limits of the API operations.</p>
ThrottlingException(crate::error::ThrottlingException),
///
/// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
///
/// When logging an error from the SDK, it is recommended that you either wrap the error in
/// [`DisplayErrorContext`](crate::types::DisplayErrorContext), use another
/// error reporter library that visits the error's cause/source chain, or call
/// [`Error::source`](std::error::Error::source) for more details about the underlying cause.
///
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for ListUsersError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListUsersErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
ListUsersErrorKind::ValidationException(_inner) => _inner.fmt(f),
ListUsersErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
ListUsersErrorKind::InternalServerException(_inner) => _inner.fmt(f),
ListUsersErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
ListUsersErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListUsersError {
fn code(&self) -> Option<&str> {
ListUsersError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
match &self.kind {
ListUsersErrorKind::InternalServerException(inner) => {
Some(inner.retryable_error_kind())
}
ListUsersErrorKind::ThrottlingException(inner) => Some(inner.retryable_error_kind()),
_ => None,
}
}
}
impl ListUsersError {
/// Creates a new `ListUsersError`.
pub fn new(kind: ListUsersErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `ListUsersError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: ListUsersErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
/// Creates the `ListUsersError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListUsersErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `ListUsersErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(&self.kind, ListUsersErrorKind::ResourceNotFoundException(_))
}
/// Returns `true` if the error kind is `ListUsersErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, ListUsersErrorKind::ValidationException(_))
}
/// Returns `true` if the error kind is `ListUsersErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, ListUsersErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `ListUsersErrorKind::InternalServerException`.
pub fn is_internal_server_exception(&self) -> bool {
matches!(&self.kind, ListUsersErrorKind::InternalServerException(_))
}
/// Returns `true` if the error kind is `ListUsersErrorKind::ThrottlingException`.
pub fn is_throttling_exception(&self) -> bool {
matches!(&self.kind, ListUsersErrorKind::ThrottlingException(_))
}
}
impl std::error::Error for ListUsersError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListUsersErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
ListUsersErrorKind::ValidationException(_inner) => Some(_inner),
ListUsersErrorKind::AccessDeniedException(_inner) => Some(_inner),
ListUsersErrorKind::InternalServerException(_inner) => Some(_inner),
ListUsersErrorKind::ThrottlingException(_inner) => Some(_inner),
ListUsersErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
/// <p>The request failed because it contains a syntax error.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ValidationException {
#[allow(missing_docs)] // documentation missing in model
#[doc(hidden)]
pub message: std::option::Option<std::string::String>,
/// <p>The identifier for each request. This value is a globally unique ID that is generated by the identity store service for each sent request, and is then returned inside the exception if the request fails.</p>
#[doc(hidden)]
pub request_id: std::option::Option<std::string::String>,
}
impl ValidationException {
/// <p>The identifier for each request. This value is a globally unique ID that is generated by the identity store service for each sent request, and is then returned inside the exception if the request fails.</p>
pub fn request_id(&self) -> std::option::Option<&str> {
self.request_id.as_deref()
}
}
impl ValidationException {
/// Returns the error message.
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for ValidationException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "ValidationException")?;
if let Some(inner_4) = &self.message {
{
write!(f, ": {}", inner_4)?;
}
}
Ok(())
}
}
impl std::error::Error for ValidationException {}
/// See [`ValidationException`](crate::error::ValidationException).
pub mod validation_exception {
/// A builder for [`ValidationException`](crate::error::ValidationException).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
pub(crate) request_id: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// <p>The identifier for each request. This value is a globally unique ID that is generated by the identity store service for each sent request, and is then returned inside the exception if the request fails.</p>
pub fn request_id(mut self, input: impl Into<std::string::String>) -> Self {
self.request_id = Some(input.into());
self
}
/// <p>The identifier for each request. This value is a globally unique ID that is generated by the identity store service for each sent request, and is then returned inside the exception if the request fails.</p>
pub fn set_request_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.request_id = input;
self
}
/// Consumes the builder and constructs a [`ValidationException`](crate::error::ValidationException).
pub fn build(self) -> crate::error::ValidationException {
crate::error::ValidationException {
message: self.message,
request_id: self.request_id,
}
}
}
}
impl ValidationException {
/// Creates a new builder-style object to manufacture [`ValidationException`](crate::error::ValidationException).
pub fn builder() -> crate::error::validation_exception::Builder {
crate::error::validation_exception::Builder::default()
}
}
/// <p>Indicates that a requested resource is not found.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ResourceNotFoundException {
/// <p>An enum object indicating the type of resource in the identity store service. Valid values include USER, GROUP, and IDENTITY_STORE.</p>
#[doc(hidden)]
pub resource_type: std::option::Option<crate::model::ResourceType>,
/// <p>The identifier for a resource in the identity store that can be used as <code>UserId</code> or <code>GroupId</code>. The format for <code>ResourceId</code> is either <code>UUID</code> or <code>1234567890-UUID</code>, where <code>UUID</code> is a randomly generated value for each resource when it is created and <code>1234567890</code> represents the <code>IdentityStoreId</code> string value. In the case that the identity store is migrated from a legacy SSO identity store, the <code>ResourceId</code> for that identity store will be in the format of <code>UUID</code>. Otherwise, it will be in the <code>1234567890-UUID</code> format.</p>
#[doc(hidden)]
pub resource_id: std::option::Option<std::string::String>,
#[allow(missing_docs)] // documentation missing in model
#[doc(hidden)]
pub message: std::option::Option<std::string::String>,
/// <p>The identifier for each request. This value is a globally unique ID that is generated by the identity store service for each sent request, and is then returned inside the exception if the request fails.</p>
#[doc(hidden)]
pub request_id: std::option::Option<std::string::String>,
}
impl ResourceNotFoundException {
/// <p>An enum object indicating the type of resource in the identity store service. Valid values include USER, GROUP, and IDENTITY_STORE.</p>
pub fn resource_type(&self) -> std::option::Option<&crate::model::ResourceType> {
self.resource_type.as_ref()
}
/// <p>The identifier for a resource in the identity store that can be used as <code>UserId</code> or <code>GroupId</code>. The format for <code>ResourceId</code> is either <code>UUID</code> or <code>1234567890-UUID</code>, where <code>UUID</code> is a randomly generated value for each resource when it is created and <code>1234567890</code> represents the <code>IdentityStoreId</code> string value. In the case that the identity store is migrated from a legacy SSO identity store, the <code>ResourceId</code> for that identity store will be in the format of <code>UUID</code>. Otherwise, it will be in the <code>1234567890-UUID</code> format.</p>
pub fn resource_id(&self) -> std::option::Option<&str> {
self.resource_id.as_deref()
}
/// <p>The identifier for each request. This value is a globally unique ID that is generated by the identity store service for each sent request, and is then returned inside the exception if the request fails.</p>
pub fn request_id(&self) -> std::option::Option<&str> {
self.request_id.as_deref()
}
}
impl ResourceNotFoundException {
/// Returns the error message.
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for ResourceNotFoundException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "ResourceNotFoundException")?;
if let Some(inner_5) = &self.message {
{
write!(f, ": {}", inner_5)?;
}
}
Ok(())
}
}
impl std::error::Error for ResourceNotFoundException {}
/// See [`ResourceNotFoundException`](crate::error::ResourceNotFoundException).
pub mod resource_not_found_exception {
/// A builder for [`ResourceNotFoundException`](crate::error::ResourceNotFoundException).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) resource_type: std::option::Option<crate::model::ResourceType>,
pub(crate) resource_id: std::option::Option<std::string::String>,
pub(crate) message: std::option::Option<std::string::String>,
pub(crate) request_id: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>An enum object indicating the type of resource in the identity store service. Valid values include USER, GROUP, and IDENTITY_STORE.</p>
pub fn resource_type(mut self, input: crate::model::ResourceType) -> Self {
self.resource_type = Some(input);
self
}
/// <p>An enum object indicating the type of resource in the identity store service. Valid values include USER, GROUP, and IDENTITY_STORE.</p>
pub fn set_resource_type(
mut self,
input: std::option::Option<crate::model::ResourceType>,
) -> Self {
self.resource_type = input;
self
}
/// <p>The identifier for a resource in the identity store that can be used as <code>UserId</code> or <code>GroupId</code>. The format for <code>ResourceId</code> is either <code>UUID</code> or <code>1234567890-UUID</code>, where <code>UUID</code> is a randomly generated value for each resource when it is created and <code>1234567890</code> represents the <code>IdentityStoreId</code> string value. In the case that the identity store is migrated from a legacy SSO identity store, the <code>ResourceId</code> for that identity store will be in the format of <code>UUID</code>. Otherwise, it will be in the <code>1234567890-UUID</code> format.</p>
pub fn resource_id(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_id = Some(input.into());
self
}
/// <p>The identifier for a resource in the identity store that can be used as <code>UserId</code> or <code>GroupId</code>. The format for <code>ResourceId</code> is either <code>UUID</code> or <code>1234567890-UUID</code>, where <code>UUID</code> is a randomly generated value for each resource when it is created and <code>1234567890</code> represents the <code>IdentityStoreId</code> string value. In the case that the identity store is migrated from a legacy SSO identity store, the <code>ResourceId</code> for that identity store will be in the format of <code>UUID</code>. Otherwise, it will be in the <code>1234567890-UUID</code> format.</p>
pub fn set_resource_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource_id = input;
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// <p>The identifier for each request. This value is a globally unique ID that is generated by the identity store service for each sent request, and is then returned inside the exception if the request fails.</p>
pub fn request_id(mut self, input: impl Into<std::string::String>) -> Self {
self.request_id = Some(input.into());
self
}
/// <p>The identifier for each request. This value is a globally unique ID that is generated by the identity store service for each sent request, and is then returned inside the exception if the request fails.</p>
pub fn set_request_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.request_id = input;
self
}
/// Consumes the builder and constructs a [`ResourceNotFoundException`](crate::error::ResourceNotFoundException).
pub fn build(self) -> crate::error::ResourceNotFoundException {
crate::error::ResourceNotFoundException {
resource_type: self.resource_type,
resource_id: self.resource_id,
message: self.message,
request_id: self.request_id,
}
}
}
}
impl ResourceNotFoundException {
/// Creates a new builder-style object to manufacture [`ResourceNotFoundException`](crate::error::ResourceNotFoundException).
pub fn builder() -> crate::error::resource_not_found_exception::Builder {
crate::error::resource_not_found_exception::Builder::default()
}
}
/// Error type for the `CreateUser` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct CreateUserError {
/// Kind of error that occurred.
pub kind: CreateUserErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for CreateUserError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: CreateUserErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
/// Types of errors that can occur for the `CreateUser` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum CreateUserErrorKind {
/// <p>This request cannot be completed for one of the following reasons:</p>
/// <ul>
/// <li> <p>Performing the requested operation would violate an existing uniqueness claim in the identity store. Resolve the conflict before retrying this request.</p> </li>
/// <li> <p>The requested resource was being concurrently modified by another request.</p> </li>
/// </ul>
ConflictException(crate::error::ConflictException),
/// <p>Indicates that a requested resource is not found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>The request would cause the number of users or groups in the identity store to exceed the maximum allowed.</p>
ServiceQuotaExceededException(crate::error::ServiceQuotaExceededException),
/// <p>The request failed because it contains a syntax error.</p>
ValidationException(crate::error::ValidationException),
/// <p>You do not have sufficient access to perform this action.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>The request processing has failed because of an unknown error, exception or failure with an internal server.</p>
InternalServerException(crate::error::InternalServerException),
/// <p>Indicates that the principal has crossed the throttling limits of the API operations.</p>
ThrottlingException(crate::error::ThrottlingException),
///
/// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
///
/// When logging an error from the SDK, it is recommended that you either wrap the error in
/// [`DisplayErrorContext`](crate::types::DisplayErrorContext), use another
/// error reporter library that visits the error's cause/source chain, or call
/// [`Error::source`](std::error::Error::source) for more details about the underlying cause.
///
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for CreateUserError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
CreateUserErrorKind::ConflictException(_inner) => _inner.fmt(f),
CreateUserErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
CreateUserErrorKind::ServiceQuotaExceededException(_inner) => _inner.fmt(f),
CreateUserErrorKind::ValidationException(_inner) => _inner.fmt(f),
CreateUserErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
CreateUserErrorKind::InternalServerException(_inner) => _inner.fmt(f),
CreateUserErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
CreateUserErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for CreateUserError {
fn code(&self) -> Option<&str> {
CreateUserError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
match &self.kind {
CreateUserErrorKind::InternalServerException(inner) => {
Some(inner.retryable_error_kind())
}
CreateUserErrorKind::ThrottlingException(inner) => Some(inner.retryable_error_kind()),
_ => None,
}
}
}
impl CreateUserError {
/// Creates a new `CreateUserError`.
pub fn new(kind: CreateUserErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `CreateUserError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: CreateUserErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
/// Creates the `CreateUserError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: CreateUserErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `CreateUserErrorKind::ConflictException`.
pub fn is_conflict_exception(&self) -> bool {
matches!(&self.kind, CreateUserErrorKind::ConflictException(_))
}
/// Returns `true` if the error kind is `CreateUserErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
CreateUserErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `CreateUserErrorKind::ServiceQuotaExceededException`.
pub fn is_service_quota_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
CreateUserErrorKind::ServiceQuotaExceededException(_)
)
}
/// Returns `true` if the error kind is `CreateUserErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, CreateUserErrorKind::ValidationException(_))
}
/// Returns `true` if the error kind is `CreateUserErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, CreateUserErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `CreateUserErrorKind::InternalServerException`.
pub fn is_internal_server_exception(&self) -> bool {
matches!(&self.kind, CreateUserErrorKind::InternalServerException(_))
}
/// Returns `true` if the error kind is `CreateUserErrorKind::ThrottlingException`.
pub fn is_throttling_exception(&self) -> bool {
matches!(&self.kind, CreateUserErrorKind::ThrottlingException(_))
}
}
impl std::error::Error for CreateUserError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
CreateUserErrorKind::ConflictException(_inner) => Some(_inner),
CreateUserErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
CreateUserErrorKind::ServiceQuotaExceededException(_inner) => Some(_inner),
CreateUserErrorKind::ValidationException(_inner) => Some(_inner),
CreateUserErrorKind::AccessDeniedException(_inner) => Some(_inner),
CreateUserErrorKind::InternalServerException(_inner) => Some(_inner),
CreateUserErrorKind::ThrottlingException(_inner) => Some(_inner),
CreateUserErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
/// <p>The request would cause the number of users or groups in the identity store to exceed the maximum allowed.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ServiceQuotaExceededException {
#[allow(missing_docs)] // documentation missing in model
#[doc(hidden)]
pub message: std::option::Option<std::string::String>,
/// <p>The identifier for each request. This value is a globally unique ID that is generated by the identity store service for each sent request, and is then returned inside the exception if the request fails.</p>
#[doc(hidden)]
pub request_id: std::option::Option<std::string::String>,
}
impl ServiceQuotaExceededException {
/// <p>The identifier for each request. This value is a globally unique ID that is generated by the identity store service for each sent request, and is then returned inside the exception if the request fails.</p>
pub fn request_id(&self) -> std::option::Option<&str> {
self.request_id.as_deref()
}
}
impl ServiceQuotaExceededException {
/// Returns the error message.
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for ServiceQuotaExceededException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "ServiceQuotaExceededException")?;
if let Some(inner_6) = &self.message {
{
write!(f, ": {}", inner_6)?;
}
}
Ok(())
}
}
impl std::error::Error for ServiceQuotaExceededException {}
/// See [`ServiceQuotaExceededException`](crate::error::ServiceQuotaExceededException).
pub mod service_quota_exceeded_exception {
/// A builder for [`ServiceQuotaExceededException`](crate::error::ServiceQuotaExceededException).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
pub(crate) request_id: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// <p>The identifier for each request. This value is a globally unique ID that is generated by the identity store service for each sent request, and is then returned inside the exception if the request fails.</p>
pub fn request_id(mut self, input: impl Into<std::string::String>) -> Self {
self.request_id = Some(input.into());
self
}
/// <p>The identifier for each request. This value is a globally unique ID that is generated by the identity store service for each sent request, and is then returned inside the exception if the request fails.</p>
pub fn set_request_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.request_id = input;
self
}
/// Consumes the builder and constructs a [`ServiceQuotaExceededException`](crate::error::ServiceQuotaExceededException).
pub fn build(self) -> crate::error::ServiceQuotaExceededException {
crate::error::ServiceQuotaExceededException {
message: self.message,
request_id: self.request_id,
}
}
}
}
impl ServiceQuotaExceededException {
/// Creates a new builder-style object to manufacture [`ServiceQuotaExceededException`](crate::error::ServiceQuotaExceededException).
pub fn builder() -> crate::error::service_quota_exceeded_exception::Builder {
crate::error::service_quota_exceeded_exception::Builder::default()
}
}
/// <p>This request cannot be completed for one of the following reasons:</p>
/// <ul>
/// <li> <p>Performing the requested operation would violate an existing uniqueness claim in the identity store. Resolve the conflict before retrying this request.</p> </li>
/// <li> <p>The requested resource was being concurrently modified by another request.</p> </li>
/// </ul>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ConflictException {
#[allow(missing_docs)] // documentation missing in model
#[doc(hidden)]
pub message: std::option::Option<std::string::String>,
/// <p>The identifier for each request. This value is a globally unique ID that is generated by the identity store service for each sent request, and is then returned inside the exception if the request fails.</p>
#[doc(hidden)]
pub request_id: std::option::Option<std::string::String>,
/// <p>This request cannot be completed for one of the following reasons:</p>
/// <ul>
/// <li> <p>Performing the requested operation would violate an existing uniqueness claim in the identity store. Resolve the conflict before retrying this request.</p> </li>
/// <li> <p>The requested resource was being concurrently modified by another request.</p> </li>
/// </ul>
#[doc(hidden)]
pub reason: std::option::Option<crate::model::ConflictExceptionReason>,
}
impl ConflictException {
/// <p>The identifier for each request. This value is a globally unique ID that is generated by the identity store service for each sent request, and is then returned inside the exception if the request fails.</p>
pub fn request_id(&self) -> std::option::Option<&str> {
self.request_id.as_deref()
}
/// <p>This request cannot be completed for one of the following reasons:</p>
/// <ul>
/// <li> <p>Performing the requested operation would violate an existing uniqueness claim in the identity store. Resolve the conflict before retrying this request.</p> </li>
/// <li> <p>The requested resource was being concurrently modified by another request.</p> </li>
/// </ul>
pub fn reason(&self) -> std::option::Option<&crate::model::ConflictExceptionReason> {
self.reason.as_ref()
}
}
impl ConflictException {
/// Returns the error message.
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for ConflictException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "ConflictException")?;
if let Some(inner_7) = &self.message {
{
write!(f, ": {}", inner_7)?;
}
}
Ok(())
}
}
impl std::error::Error for ConflictException {}
/// See [`ConflictException`](crate::error::ConflictException).
pub mod conflict_exception {
/// A builder for [`ConflictException`](crate::error::ConflictException).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
pub(crate) request_id: std::option::Option<std::string::String>,
pub(crate) reason: std::option::Option<crate::model::ConflictExceptionReason>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// <p>The identifier for each request. This value is a globally unique ID that is generated by the identity store service for each sent request, and is then returned inside the exception if the request fails.</p>
pub fn request_id(mut self, input: impl Into<std::string::String>) -> Self {
self.request_id = Some(input.into());
self
}
/// <p>The identifier for each request. This value is a globally unique ID that is generated by the identity store service for each sent request, and is then returned inside the exception if the request fails.</p>
pub fn set_request_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.request_id = input;
self
}
/// <p>This request cannot be completed for one of the following reasons:</p>
/// <ul>
/// <li> <p>Performing the requested operation would violate an existing uniqueness claim in the identity store. Resolve the conflict before retrying this request.</p> </li>
/// <li> <p>The requested resource was being concurrently modified by another request.</p> </li>
/// </ul>
pub fn reason(mut self, input: crate::model::ConflictExceptionReason) -> Self {
self.reason = Some(input);
self
}
/// <p>This request cannot be completed for one of the following reasons:</p>
/// <ul>
/// <li> <p>Performing the requested operation would violate an existing uniqueness claim in the identity store. Resolve the conflict before retrying this request.</p> </li>
/// <li> <p>The requested resource was being concurrently modified by another request.</p> </li>
/// </ul>
pub fn set_reason(
mut self,
input: std::option::Option<crate::model::ConflictExceptionReason>,
) -> Self {
self.reason = input;
self
}
/// Consumes the builder and constructs a [`ConflictException`](crate::error::ConflictException).
pub fn build(self) -> crate::error::ConflictException {
crate::error::ConflictException {
message: self.message,
request_id: self.request_id,
reason: self.reason,
}
}
}
}
impl ConflictException {
/// Creates a new builder-style object to manufacture [`ConflictException`](crate::error::ConflictException).
pub fn builder() -> crate::error::conflict_exception::Builder {
crate::error::conflict_exception::Builder::default()
}
}
/// Error type for the `DeleteUser` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DeleteUserError {
/// Kind of error that occurred.
pub kind: DeleteUserErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for DeleteUserError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: DeleteUserErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
/// Types of errors that can occur for the `DeleteUser` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DeleteUserErrorKind {
/// <p>This request cannot be completed for one of the following reasons:</p>
/// <ul>
/// <li> <p>Performing the requested operation would violate an existing uniqueness claim in the identity store. Resolve the conflict before retrying this request.</p> </li>
/// <li> <p>The requested resource was being concurrently modified by another request.</p> </li>
/// </ul>
ConflictException(crate::error::ConflictException),
/// <p>Indicates that a requested resource is not found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>The request failed because it contains a syntax error.</p>
ValidationException(crate::error::ValidationException),
/// <p>You do not have sufficient access to perform this action.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>The request processing has failed because of an unknown error, exception or failure with an internal server.</p>
InternalServerException(crate::error::InternalServerException),
/// <p>Indicates that the principal has crossed the throttling limits of the API operations.</p>
ThrottlingException(crate::error::ThrottlingException),
///
/// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
///
/// When logging an error from the SDK, it is recommended that you either wrap the error in
/// [`DisplayErrorContext`](crate::types::DisplayErrorContext), use another
/// error reporter library that visits the error's cause/source chain, or call
/// [`Error::source`](std::error::Error::source) for more details about the underlying cause.
///
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for DeleteUserError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DeleteUserErrorKind::ConflictException(_inner) => _inner.fmt(f),
DeleteUserErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
DeleteUserErrorKind::ValidationException(_inner) => _inner.fmt(f),
DeleteUserErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
DeleteUserErrorKind::InternalServerException(_inner) => _inner.fmt(f),
DeleteUserErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
DeleteUserErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DeleteUserError {
fn code(&self) -> Option<&str> {
DeleteUserError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
match &self.kind {
DeleteUserErrorKind::InternalServerException(inner) => {
Some(inner.retryable_error_kind())
}
DeleteUserErrorKind::ThrottlingException(inner) => Some(inner.retryable_error_kind()),
_ => None,
}
}
}
impl DeleteUserError {
/// Creates a new `DeleteUserError`.
pub fn new(kind: DeleteUserErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `DeleteUserError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: DeleteUserErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
/// Creates the `DeleteUserError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DeleteUserErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `DeleteUserErrorKind::ConflictException`.
pub fn is_conflict_exception(&self) -> bool {
matches!(&self.kind, DeleteUserErrorKind::ConflictException(_))
}
/// Returns `true` if the error kind is `DeleteUserErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
DeleteUserErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `DeleteUserErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, DeleteUserErrorKind::ValidationException(_))
}
/// Returns `true` if the error kind is `DeleteUserErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, DeleteUserErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `DeleteUserErrorKind::InternalServerException`.
pub fn is_internal_server_exception(&self) -> bool {
matches!(&self.kind, DeleteUserErrorKind::InternalServerException(_))
}
/// Returns `true` if the error kind is `DeleteUserErrorKind::ThrottlingException`.
pub fn is_throttling_exception(&self) -> bool {
matches!(&self.kind, DeleteUserErrorKind::ThrottlingException(_))
}
}
impl std::error::Error for DeleteUserError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DeleteUserErrorKind::ConflictException(_inner) => Some(_inner),
DeleteUserErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
DeleteUserErrorKind::ValidationException(_inner) => Some(_inner),
DeleteUserErrorKind::AccessDeniedException(_inner) => Some(_inner),
DeleteUserErrorKind::InternalServerException(_inner) => Some(_inner),
DeleteUserErrorKind::ThrottlingException(_inner) => Some(_inner),
DeleteUserErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
/// Error type for the `UpdateUser` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct UpdateUserError {
/// Kind of error that occurred.
pub kind: UpdateUserErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for UpdateUserError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: UpdateUserErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
/// Types of errors that can occur for the `UpdateUser` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum UpdateUserErrorKind {
/// <p>This request cannot be completed for one of the following reasons:</p>
/// <ul>
/// <li> <p>Performing the requested operation would violate an existing uniqueness claim in the identity store. Resolve the conflict before retrying this request.</p> </li>
/// <li> <p>The requested resource was being concurrently modified by another request.</p> </li>
/// </ul>
ConflictException(crate::error::ConflictException),
/// <p>Indicates that a requested resource is not found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>The request would cause the number of users or groups in the identity store to exceed the maximum allowed.</p>
ServiceQuotaExceededException(crate::error::ServiceQuotaExceededException),
/// <p>The request failed because it contains a syntax error.</p>
ValidationException(crate::error::ValidationException),
/// <p>You do not have sufficient access to perform this action.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>The request processing has failed because of an unknown error, exception or failure with an internal server.</p>
InternalServerException(crate::error::InternalServerException),
/// <p>Indicates that the principal has crossed the throttling limits of the API operations.</p>
ThrottlingException(crate::error::ThrottlingException),
///
/// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
///
/// When logging an error from the SDK, it is recommended that you either wrap the error in
/// [`DisplayErrorContext`](crate::types::DisplayErrorContext), use another
/// error reporter library that visits the error's cause/source chain, or call
/// [`Error::source`](std::error::Error::source) for more details about the underlying cause.
///
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for UpdateUserError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
UpdateUserErrorKind::ConflictException(_inner) => _inner.fmt(f),
UpdateUserErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
UpdateUserErrorKind::ServiceQuotaExceededException(_inner) => _inner.fmt(f),
UpdateUserErrorKind::ValidationException(_inner) => _inner.fmt(f),
UpdateUserErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
UpdateUserErrorKind::InternalServerException(_inner) => _inner.fmt(f),
UpdateUserErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
UpdateUserErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for UpdateUserError {
fn code(&self) -> Option<&str> {
UpdateUserError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
match &self.kind {
UpdateUserErrorKind::InternalServerException(inner) => {
Some(inner.retryable_error_kind())
}
UpdateUserErrorKind::ThrottlingException(inner) => Some(inner.retryable_error_kind()),
_ => None,
}
}
}
impl UpdateUserError {
/// Creates a new `UpdateUserError`.
pub fn new(kind: UpdateUserErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `UpdateUserError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: UpdateUserErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
/// Creates the `UpdateUserError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: UpdateUserErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `UpdateUserErrorKind::ConflictException`.
pub fn is_conflict_exception(&self) -> bool {
matches!(&self.kind, UpdateUserErrorKind::ConflictException(_))
}
/// Returns `true` if the error kind is `UpdateUserErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
UpdateUserErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `UpdateUserErrorKind::ServiceQuotaExceededException`.
pub fn is_service_quota_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
UpdateUserErrorKind::ServiceQuotaExceededException(_)
)
}
/// Returns `true` if the error kind is `UpdateUserErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, UpdateUserErrorKind::ValidationException(_))
}
/// Returns `true` if the error kind is `UpdateUserErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, UpdateUserErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `UpdateUserErrorKind::InternalServerException`.
pub fn is_internal_server_exception(&self) -> bool {
matches!(&self.kind, UpdateUserErrorKind::InternalServerException(_))
}
/// Returns `true` if the error kind is `UpdateUserErrorKind::ThrottlingException`.
pub fn is_throttling_exception(&self) -> bool {
matches!(&self.kind, UpdateUserErrorKind::ThrottlingException(_))
}
}
impl std::error::Error for UpdateUserError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
UpdateUserErrorKind::ConflictException(_inner) => Some(_inner),
UpdateUserErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
UpdateUserErrorKind::ServiceQuotaExceededException(_inner) => Some(_inner),
UpdateUserErrorKind::ValidationException(_inner) => Some(_inner),
UpdateUserErrorKind::AccessDeniedException(_inner) => Some(_inner),
UpdateUserErrorKind::InternalServerException(_inner) => Some(_inner),
UpdateUserErrorKind::ThrottlingException(_inner) => Some(_inner),
UpdateUserErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
/// Error type for the `DescribeUser` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DescribeUserError {
/// Kind of error that occurred.
pub kind: DescribeUserErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for DescribeUserError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: DescribeUserErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
/// Types of errors that can occur for the `DescribeUser` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DescribeUserErrorKind {
/// <p>Indicates that a requested resource is not found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>The request failed because it contains a syntax error.</p>
ValidationException(crate::error::ValidationException),
/// <p>You do not have sufficient access to perform this action.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>The request processing has failed because of an unknown error, exception or failure with an internal server.</p>
InternalServerException(crate::error::InternalServerException),
/// <p>Indicates that the principal has crossed the throttling limits of the API operations.</p>
ThrottlingException(crate::error::ThrottlingException),
///
/// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
///
/// When logging an error from the SDK, it is recommended that you either wrap the error in
/// [`DisplayErrorContext`](crate::types::DisplayErrorContext), use another
/// error reporter library that visits the error's cause/source chain, or call
/// [`Error::source`](std::error::Error::source) for more details about the underlying cause.
///
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for DescribeUserError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DescribeUserErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
DescribeUserErrorKind::ValidationException(_inner) => _inner.fmt(f),
DescribeUserErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
DescribeUserErrorKind::InternalServerException(_inner) => _inner.fmt(f),
DescribeUserErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
DescribeUserErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DescribeUserError {
fn code(&self) -> Option<&str> {
DescribeUserError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
match &self.kind {
DescribeUserErrorKind::InternalServerException(inner) => {
Some(inner.retryable_error_kind())
}
DescribeUserErrorKind::ThrottlingException(inner) => Some(inner.retryable_error_kind()),
_ => None,
}
}
}
impl DescribeUserError {
/// Creates a new `DescribeUserError`.
pub fn new(kind: DescribeUserErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `DescribeUserError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: DescribeUserErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
/// Creates the `DescribeUserError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DescribeUserErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `DescribeUserErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
DescribeUserErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `DescribeUserErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, DescribeUserErrorKind::ValidationException(_))
}
/// Returns `true` if the error kind is `DescribeUserErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, DescribeUserErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `DescribeUserErrorKind::InternalServerException`.
pub fn is_internal_server_exception(&self) -> bool {
matches!(
&self.kind,
DescribeUserErrorKind::InternalServerException(_)
)
}
/// Returns `true` if the error kind is `DescribeUserErrorKind::ThrottlingException`.
pub fn is_throttling_exception(&self) -> bool {
matches!(&self.kind, DescribeUserErrorKind::ThrottlingException(_))
}
}
impl std::error::Error for DescribeUserError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DescribeUserErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
DescribeUserErrorKind::ValidationException(_inner) => Some(_inner),
DescribeUserErrorKind::AccessDeniedException(_inner) => Some(_inner),
DescribeUserErrorKind::InternalServerException(_inner) => Some(_inner),
DescribeUserErrorKind::ThrottlingException(_inner) => Some(_inner),
DescribeUserErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
/// Error type for the `ListGroups` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListGroupsError {
/// Kind of error that occurred.
pub kind: ListGroupsErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for ListGroupsError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: ListGroupsErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
/// Types of errors that can occur for the `ListGroups` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListGroupsErrorKind {
/// <p>Indicates that a requested resource is not found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>The request failed because it contains a syntax error.</p>
ValidationException(crate::error::ValidationException),
/// <p>You do not have sufficient access to perform this action.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>The request processing has failed because of an unknown error, exception or failure with an internal server.</p>
InternalServerException(crate::error::InternalServerException),
/// <p>Indicates that the principal has crossed the throttling limits of the API operations.</p>
ThrottlingException(crate::error::ThrottlingException),
///
/// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
///
/// When logging an error from the SDK, it is recommended that you either wrap the error in
/// [`DisplayErrorContext`](crate::types::DisplayErrorContext), use another
/// error reporter library that visits the error's cause/source chain, or call
/// [`Error::source`](std::error::Error::source) for more details about the underlying cause.
///
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for ListGroupsError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListGroupsErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
ListGroupsErrorKind::ValidationException(_inner) => _inner.fmt(f),
ListGroupsErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
ListGroupsErrorKind::InternalServerException(_inner) => _inner.fmt(f),
ListGroupsErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
ListGroupsErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListGroupsError {
fn code(&self) -> Option<&str> {
ListGroupsError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
match &self.kind {
ListGroupsErrorKind::InternalServerException(inner) => {
Some(inner.retryable_error_kind())
}
ListGroupsErrorKind::ThrottlingException(inner) => Some(inner.retryable_error_kind()),
_ => None,
}
}
}
impl ListGroupsError {
/// Creates a new `ListGroupsError`.
pub fn new(kind: ListGroupsErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `ListGroupsError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: ListGroupsErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
/// Creates the `ListGroupsError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListGroupsErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `ListGroupsErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
ListGroupsErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `ListGroupsErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, ListGroupsErrorKind::ValidationException(_))
}
/// Returns `true` if the error kind is `ListGroupsErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, ListGroupsErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `ListGroupsErrorKind::InternalServerException`.
pub fn is_internal_server_exception(&self) -> bool {
matches!(&self.kind, ListGroupsErrorKind::InternalServerException(_))
}
/// Returns `true` if the error kind is `ListGroupsErrorKind::ThrottlingException`.
pub fn is_throttling_exception(&self) -> bool {
matches!(&self.kind, ListGroupsErrorKind::ThrottlingException(_))
}
}
impl std::error::Error for ListGroupsError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListGroupsErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
ListGroupsErrorKind::ValidationException(_inner) => Some(_inner),
ListGroupsErrorKind::AccessDeniedException(_inner) => Some(_inner),
ListGroupsErrorKind::InternalServerException(_inner) => Some(_inner),
ListGroupsErrorKind::ThrottlingException(_inner) => Some(_inner),
ListGroupsErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
/// Error type for the `CreateGroup` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct CreateGroupError {
/// Kind of error that occurred.
pub kind: CreateGroupErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for CreateGroupError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: CreateGroupErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
/// Types of errors that can occur for the `CreateGroup` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum CreateGroupErrorKind {
/// <p>This request cannot be completed for one of the following reasons:</p>
/// <ul>
/// <li> <p>Performing the requested operation would violate an existing uniqueness claim in the identity store. Resolve the conflict before retrying this request.</p> </li>
/// <li> <p>The requested resource was being concurrently modified by another request.</p> </li>
/// </ul>
ConflictException(crate::error::ConflictException),
/// <p>Indicates that a requested resource is not found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>The request would cause the number of users or groups in the identity store to exceed the maximum allowed.</p>
ServiceQuotaExceededException(crate::error::ServiceQuotaExceededException),
/// <p>The request failed because it contains a syntax error.</p>
ValidationException(crate::error::ValidationException),
/// <p>You do not have sufficient access to perform this action.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>The request processing has failed because of an unknown error, exception or failure with an internal server.</p>
InternalServerException(crate::error::InternalServerException),
/// <p>Indicates that the principal has crossed the throttling limits of the API operations.</p>
ThrottlingException(crate::error::ThrottlingException),
///
/// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
///
/// When logging an error from the SDK, it is recommended that you either wrap the error in
/// [`DisplayErrorContext`](crate::types::DisplayErrorContext), use another
/// error reporter library that visits the error's cause/source chain, or call
/// [`Error::source`](std::error::Error::source) for more details about the underlying cause.
///
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for CreateGroupError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
CreateGroupErrorKind::ConflictException(_inner) => _inner.fmt(f),
CreateGroupErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
CreateGroupErrorKind::ServiceQuotaExceededException(_inner) => _inner.fmt(f),
CreateGroupErrorKind::ValidationException(_inner) => _inner.fmt(f),
CreateGroupErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
CreateGroupErrorKind::InternalServerException(_inner) => _inner.fmt(f),
CreateGroupErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
CreateGroupErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for CreateGroupError {
fn code(&self) -> Option<&str> {
CreateGroupError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
match &self.kind {
CreateGroupErrorKind::InternalServerException(inner) => {
Some(inner.retryable_error_kind())
}
CreateGroupErrorKind::ThrottlingException(inner) => Some(inner.retryable_error_kind()),
_ => None,
}
}
}
impl CreateGroupError {
/// Creates a new `CreateGroupError`.
pub fn new(kind: CreateGroupErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `CreateGroupError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: CreateGroupErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
/// Creates the `CreateGroupError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: CreateGroupErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `CreateGroupErrorKind::ConflictException`.
pub fn is_conflict_exception(&self) -> bool {
matches!(&self.kind, CreateGroupErrorKind::ConflictException(_))
}
/// Returns `true` if the error kind is `CreateGroupErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
CreateGroupErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `CreateGroupErrorKind::ServiceQuotaExceededException`.
pub fn is_service_quota_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
CreateGroupErrorKind::ServiceQuotaExceededException(_)
)
}
/// Returns `true` if the error kind is `CreateGroupErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, CreateGroupErrorKind::ValidationException(_))
}
/// Returns `true` if the error kind is `CreateGroupErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, CreateGroupErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `CreateGroupErrorKind::InternalServerException`.
pub fn is_internal_server_exception(&self) -> bool {
matches!(&self.kind, CreateGroupErrorKind::InternalServerException(_))
}
/// Returns `true` if the error kind is `CreateGroupErrorKind::ThrottlingException`.
pub fn is_throttling_exception(&self) -> bool {
matches!(&self.kind, CreateGroupErrorKind::ThrottlingException(_))
}
}
impl std::error::Error for CreateGroupError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
CreateGroupErrorKind::ConflictException(_inner) => Some(_inner),
CreateGroupErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
CreateGroupErrorKind::ServiceQuotaExceededException(_inner) => Some(_inner),
CreateGroupErrorKind::ValidationException(_inner) => Some(_inner),
CreateGroupErrorKind::AccessDeniedException(_inner) => Some(_inner),
CreateGroupErrorKind::InternalServerException(_inner) => Some(_inner),
CreateGroupErrorKind::ThrottlingException(_inner) => Some(_inner),
CreateGroupErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
/// Error type for the `DeleteGroup` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DeleteGroupError {
/// Kind of error that occurred.
pub kind: DeleteGroupErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for DeleteGroupError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: DeleteGroupErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
/// Types of errors that can occur for the `DeleteGroup` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DeleteGroupErrorKind {
/// <p>This request cannot be completed for one of the following reasons:</p>
/// <ul>
/// <li> <p>Performing the requested operation would violate an existing uniqueness claim in the identity store. Resolve the conflict before retrying this request.</p> </li>
/// <li> <p>The requested resource was being concurrently modified by another request.</p> </li>
/// </ul>
ConflictException(crate::error::ConflictException),
/// <p>Indicates that a requested resource is not found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>The request failed because it contains a syntax error.</p>
ValidationException(crate::error::ValidationException),
/// <p>You do not have sufficient access to perform this action.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>The request processing has failed because of an unknown error, exception or failure with an internal server.</p>
InternalServerException(crate::error::InternalServerException),
/// <p>Indicates that the principal has crossed the throttling limits of the API operations.</p>
ThrottlingException(crate::error::ThrottlingException),
///
/// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
///
/// When logging an error from the SDK, it is recommended that you either wrap the error in
/// [`DisplayErrorContext`](crate::types::DisplayErrorContext), use another
/// error reporter library that visits the error's cause/source chain, or call
/// [`Error::source`](std::error::Error::source) for more details about the underlying cause.
///
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for DeleteGroupError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DeleteGroupErrorKind::ConflictException(_inner) => _inner.fmt(f),
DeleteGroupErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
DeleteGroupErrorKind::ValidationException(_inner) => _inner.fmt(f),
DeleteGroupErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
DeleteGroupErrorKind::InternalServerException(_inner) => _inner.fmt(f),
DeleteGroupErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
DeleteGroupErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DeleteGroupError {
fn code(&self) -> Option<&str> {
DeleteGroupError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
match &self.kind {
DeleteGroupErrorKind::InternalServerException(inner) => {
Some(inner.retryable_error_kind())
}
DeleteGroupErrorKind::ThrottlingException(inner) => Some(inner.retryable_error_kind()),
_ => None,
}
}
}
impl DeleteGroupError {
/// Creates a new `DeleteGroupError`.
pub fn new(kind: DeleteGroupErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `DeleteGroupError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: DeleteGroupErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
/// Creates the `DeleteGroupError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DeleteGroupErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `DeleteGroupErrorKind::ConflictException`.
pub fn is_conflict_exception(&self) -> bool {
matches!(&self.kind, DeleteGroupErrorKind::ConflictException(_))
}
/// Returns `true` if the error kind is `DeleteGroupErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
DeleteGroupErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `DeleteGroupErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, DeleteGroupErrorKind::ValidationException(_))
}
/// Returns `true` if the error kind is `DeleteGroupErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, DeleteGroupErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `DeleteGroupErrorKind::InternalServerException`.
pub fn is_internal_server_exception(&self) -> bool {
matches!(&self.kind, DeleteGroupErrorKind::InternalServerException(_))
}
/// Returns `true` if the error kind is `DeleteGroupErrorKind::ThrottlingException`.
pub fn is_throttling_exception(&self) -> bool {
matches!(&self.kind, DeleteGroupErrorKind::ThrottlingException(_))
}
}
impl std::error::Error for DeleteGroupError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DeleteGroupErrorKind::ConflictException(_inner) => Some(_inner),
DeleteGroupErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
DeleteGroupErrorKind::ValidationException(_inner) => Some(_inner),
DeleteGroupErrorKind::AccessDeniedException(_inner) => Some(_inner),
DeleteGroupErrorKind::InternalServerException(_inner) => Some(_inner),
DeleteGroupErrorKind::ThrottlingException(_inner) => Some(_inner),
DeleteGroupErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
/// Error type for the `UpdateGroup` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct UpdateGroupError {
/// Kind of error that occurred.
pub kind: UpdateGroupErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for UpdateGroupError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: UpdateGroupErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
/// Types of errors that can occur for the `UpdateGroup` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum UpdateGroupErrorKind {
/// <p>This request cannot be completed for one of the following reasons:</p>
/// <ul>
/// <li> <p>Performing the requested operation would violate an existing uniqueness claim in the identity store. Resolve the conflict before retrying this request.</p> </li>
/// <li> <p>The requested resource was being concurrently modified by another request.</p> </li>
/// </ul>
ConflictException(crate::error::ConflictException),
/// <p>Indicates that a requested resource is not found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>The request would cause the number of users or groups in the identity store to exceed the maximum allowed.</p>
ServiceQuotaExceededException(crate::error::ServiceQuotaExceededException),
/// <p>The request failed because it contains a syntax error.</p>
ValidationException(crate::error::ValidationException),
/// <p>You do not have sufficient access to perform this action.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>The request processing has failed because of an unknown error, exception or failure with an internal server.</p>
InternalServerException(crate::error::InternalServerException),
/// <p>Indicates that the principal has crossed the throttling limits of the API operations.</p>
ThrottlingException(crate::error::ThrottlingException),
///
/// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
///
/// When logging an error from the SDK, it is recommended that you either wrap the error in
/// [`DisplayErrorContext`](crate::types::DisplayErrorContext), use another
/// error reporter library that visits the error's cause/source chain, or call
/// [`Error::source`](std::error::Error::source) for more details about the underlying cause.
///
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for UpdateGroupError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
UpdateGroupErrorKind::ConflictException(_inner) => _inner.fmt(f),
UpdateGroupErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
UpdateGroupErrorKind::ServiceQuotaExceededException(_inner) => _inner.fmt(f),
UpdateGroupErrorKind::ValidationException(_inner) => _inner.fmt(f),
UpdateGroupErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
UpdateGroupErrorKind::InternalServerException(_inner) => _inner.fmt(f),
UpdateGroupErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
UpdateGroupErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for UpdateGroupError {
fn code(&self) -> Option<&str> {
UpdateGroupError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
match &self.kind {
UpdateGroupErrorKind::InternalServerException(inner) => {
Some(inner.retryable_error_kind())
}
UpdateGroupErrorKind::ThrottlingException(inner) => Some(inner.retryable_error_kind()),
_ => None,
}
}
}
impl UpdateGroupError {
/// Creates a new `UpdateGroupError`.
pub fn new(kind: UpdateGroupErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `UpdateGroupError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: UpdateGroupErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
/// Creates the `UpdateGroupError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: UpdateGroupErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `UpdateGroupErrorKind::ConflictException`.
pub fn is_conflict_exception(&self) -> bool {
matches!(&self.kind, UpdateGroupErrorKind::ConflictException(_))
}
/// Returns `true` if the error kind is `UpdateGroupErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
UpdateGroupErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `UpdateGroupErrorKind::ServiceQuotaExceededException`.
pub fn is_service_quota_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
UpdateGroupErrorKind::ServiceQuotaExceededException(_)
)
}
/// Returns `true` if the error kind is `UpdateGroupErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, UpdateGroupErrorKind::ValidationException(_))
}
/// Returns `true` if the error kind is `UpdateGroupErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, UpdateGroupErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `UpdateGroupErrorKind::InternalServerException`.
pub fn is_internal_server_exception(&self) -> bool {
matches!(&self.kind, UpdateGroupErrorKind::InternalServerException(_))
}
/// Returns `true` if the error kind is `UpdateGroupErrorKind::ThrottlingException`.
pub fn is_throttling_exception(&self) -> bool {
matches!(&self.kind, UpdateGroupErrorKind::ThrottlingException(_))
}
}
impl std::error::Error for UpdateGroupError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
UpdateGroupErrorKind::ConflictException(_inner) => Some(_inner),
UpdateGroupErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
UpdateGroupErrorKind::ServiceQuotaExceededException(_inner) => Some(_inner),
UpdateGroupErrorKind::ValidationException(_inner) => Some(_inner),
UpdateGroupErrorKind::AccessDeniedException(_inner) => Some(_inner),
UpdateGroupErrorKind::InternalServerException(_inner) => Some(_inner),
UpdateGroupErrorKind::ThrottlingException(_inner) => Some(_inner),
UpdateGroupErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
/// Error type for the `DescribeGroup` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DescribeGroupError {
/// Kind of error that occurred.
pub kind: DescribeGroupErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for DescribeGroupError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: DescribeGroupErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
/// Types of errors that can occur for the `DescribeGroup` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DescribeGroupErrorKind {
/// <p>Indicates that a requested resource is not found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>The request failed because it contains a syntax error.</p>
ValidationException(crate::error::ValidationException),
/// <p>You do not have sufficient access to perform this action.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>The request processing has failed because of an unknown error, exception or failure with an internal server.</p>
InternalServerException(crate::error::InternalServerException),
/// <p>Indicates that the principal has crossed the throttling limits of the API operations.</p>
ThrottlingException(crate::error::ThrottlingException),
///
/// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
///
/// When logging an error from the SDK, it is recommended that you either wrap the error in
/// [`DisplayErrorContext`](crate::types::DisplayErrorContext), use another
/// error reporter library that visits the error's cause/source chain, or call
/// [`Error::source`](std::error::Error::source) for more details about the underlying cause.
///
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for DescribeGroupError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DescribeGroupErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
DescribeGroupErrorKind::ValidationException(_inner) => _inner.fmt(f),
DescribeGroupErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
DescribeGroupErrorKind::InternalServerException(_inner) => _inner.fmt(f),
DescribeGroupErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
DescribeGroupErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DescribeGroupError {
fn code(&self) -> Option<&str> {
DescribeGroupError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
match &self.kind {
DescribeGroupErrorKind::InternalServerException(inner) => {
Some(inner.retryable_error_kind())
}
DescribeGroupErrorKind::ThrottlingException(inner) => {
Some(inner.retryable_error_kind())
}
_ => None,
}
}
}
impl DescribeGroupError {
/// Creates a new `DescribeGroupError`.
pub fn new(kind: DescribeGroupErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `DescribeGroupError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: DescribeGroupErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
/// Creates the `DescribeGroupError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DescribeGroupErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `DescribeGroupErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
DescribeGroupErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `DescribeGroupErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, DescribeGroupErrorKind::ValidationException(_))
}
/// Returns `true` if the error kind is `DescribeGroupErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, DescribeGroupErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `DescribeGroupErrorKind::InternalServerException`.
pub fn is_internal_server_exception(&self) -> bool {
matches!(
&self.kind,
DescribeGroupErrorKind::InternalServerException(_)
)
}
/// Returns `true` if the error kind is `DescribeGroupErrorKind::ThrottlingException`.
pub fn is_throttling_exception(&self) -> bool {
matches!(&self.kind, DescribeGroupErrorKind::ThrottlingException(_))
}
}
impl std::error::Error for DescribeGroupError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DescribeGroupErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
DescribeGroupErrorKind::ValidationException(_inner) => Some(_inner),
DescribeGroupErrorKind::AccessDeniedException(_inner) => Some(_inner),
DescribeGroupErrorKind::InternalServerException(_inner) => Some(_inner),
DescribeGroupErrorKind::ThrottlingException(_inner) => Some(_inner),
DescribeGroupErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
/// Error type for the `ListGroupMemberships` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListGroupMembershipsError {
/// Kind of error that occurred.
pub kind: ListGroupMembershipsErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for ListGroupMembershipsError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: ListGroupMembershipsErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
/// Types of errors that can occur for the `ListGroupMemberships` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListGroupMembershipsErrorKind {
/// <p>Indicates that a requested resource is not found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>The request failed because it contains a syntax error.</p>
ValidationException(crate::error::ValidationException),
/// <p>You do not have sufficient access to perform this action.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>The request processing has failed because of an unknown error, exception or failure with an internal server.</p>
InternalServerException(crate::error::InternalServerException),
/// <p>Indicates that the principal has crossed the throttling limits of the API operations.</p>
ThrottlingException(crate::error::ThrottlingException),
///
/// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
///
/// When logging an error from the SDK, it is recommended that you either wrap the error in
/// [`DisplayErrorContext`](crate::types::DisplayErrorContext), use another
/// error reporter library that visits the error's cause/source chain, or call
/// [`Error::source`](std::error::Error::source) for more details about the underlying cause.
///
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for ListGroupMembershipsError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListGroupMembershipsErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
ListGroupMembershipsErrorKind::ValidationException(_inner) => _inner.fmt(f),
ListGroupMembershipsErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
ListGroupMembershipsErrorKind::InternalServerException(_inner) => _inner.fmt(f),
ListGroupMembershipsErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
ListGroupMembershipsErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListGroupMembershipsError {
fn code(&self) -> Option<&str> {
ListGroupMembershipsError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
match &self.kind {
ListGroupMembershipsErrorKind::InternalServerException(inner) => {
Some(inner.retryable_error_kind())
}
ListGroupMembershipsErrorKind::ThrottlingException(inner) => {
Some(inner.retryable_error_kind())
}
_ => None,
}
}
}
impl ListGroupMembershipsError {
/// Creates a new `ListGroupMembershipsError`.
pub fn new(kind: ListGroupMembershipsErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `ListGroupMembershipsError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: ListGroupMembershipsErrorKind::Unhandled(crate::error::Unhandled::new(
err.into(),
)),
meta: Default::default(),
}
}
/// Creates the `ListGroupMembershipsError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListGroupMembershipsErrorKind::Unhandled(crate::error::Unhandled::new(
err.into(),
)),
}
}
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `ListGroupMembershipsErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
ListGroupMembershipsErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `ListGroupMembershipsErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
ListGroupMembershipsErrorKind::ValidationException(_)
)
}
/// Returns `true` if the error kind is `ListGroupMembershipsErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
ListGroupMembershipsErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `ListGroupMembershipsErrorKind::InternalServerException`.
pub fn is_internal_server_exception(&self) -> bool {
matches!(
&self.kind,
ListGroupMembershipsErrorKind::InternalServerException(_)
)
}
/// Returns `true` if the error kind is `ListGroupMembershipsErrorKind::ThrottlingException`.
pub fn is_throttling_exception(&self) -> bool {
matches!(
&self.kind,
ListGroupMembershipsErrorKind::ThrottlingException(_)
)
}
}
impl std::error::Error for ListGroupMembershipsError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListGroupMembershipsErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
ListGroupMembershipsErrorKind::ValidationException(_inner) => Some(_inner),
ListGroupMembershipsErrorKind::AccessDeniedException(_inner) => Some(_inner),
ListGroupMembershipsErrorKind::InternalServerException(_inner) => Some(_inner),
ListGroupMembershipsErrorKind::ThrottlingException(_inner) => Some(_inner),
ListGroupMembershipsErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
/// Error type for the `CreateGroupMembership` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct CreateGroupMembershipError {
/// Kind of error that occurred.
pub kind: CreateGroupMembershipErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for CreateGroupMembershipError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: CreateGroupMembershipErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
/// Types of errors that can occur for the `CreateGroupMembership` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum CreateGroupMembershipErrorKind {
/// <p>This request cannot be completed for one of the following reasons:</p>
/// <ul>
/// <li> <p>Performing the requested operation would violate an existing uniqueness claim in the identity store. Resolve the conflict before retrying this request.</p> </li>
/// <li> <p>The requested resource was being concurrently modified by another request.</p> </li>
/// </ul>
ConflictException(crate::error::ConflictException),
/// <p>Indicates that a requested resource is not found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>The request would cause the number of users or groups in the identity store to exceed the maximum allowed.</p>
ServiceQuotaExceededException(crate::error::ServiceQuotaExceededException),
/// <p>The request failed because it contains a syntax error.</p>
ValidationException(crate::error::ValidationException),
/// <p>You do not have sufficient access to perform this action.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>The request processing has failed because of an unknown error, exception or failure with an internal server.</p>
InternalServerException(crate::error::InternalServerException),
/// <p>Indicates that the principal has crossed the throttling limits of the API operations.</p>
ThrottlingException(crate::error::ThrottlingException),
///
/// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
///
/// When logging an error from the SDK, it is recommended that you either wrap the error in
/// [`DisplayErrorContext`](crate::types::DisplayErrorContext), use another
/// error reporter library that visits the error's cause/source chain, or call
/// [`Error::source`](std::error::Error::source) for more details about the underlying cause.
///
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for CreateGroupMembershipError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
CreateGroupMembershipErrorKind::ConflictException(_inner) => _inner.fmt(f),
CreateGroupMembershipErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
CreateGroupMembershipErrorKind::ServiceQuotaExceededException(_inner) => _inner.fmt(f),
CreateGroupMembershipErrorKind::ValidationException(_inner) => _inner.fmt(f),
CreateGroupMembershipErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
CreateGroupMembershipErrorKind::InternalServerException(_inner) => _inner.fmt(f),
CreateGroupMembershipErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
CreateGroupMembershipErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for CreateGroupMembershipError {
fn code(&self) -> Option<&str> {
CreateGroupMembershipError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
match &self.kind {
CreateGroupMembershipErrorKind::InternalServerException(inner) => {
Some(inner.retryable_error_kind())
}
CreateGroupMembershipErrorKind::ThrottlingException(inner) => {
Some(inner.retryable_error_kind())
}
_ => None,
}
}
}
impl CreateGroupMembershipError {
/// Creates a new `CreateGroupMembershipError`.
pub fn new(kind: CreateGroupMembershipErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `CreateGroupMembershipError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: CreateGroupMembershipErrorKind::Unhandled(crate::error::Unhandled::new(
err.into(),
)),
meta: Default::default(),
}
}
/// Creates the `CreateGroupMembershipError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: CreateGroupMembershipErrorKind::Unhandled(crate::error::Unhandled::new(
err.into(),
)),
}
}
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `CreateGroupMembershipErrorKind::ConflictException`.
pub fn is_conflict_exception(&self) -> bool {
matches!(
&self.kind,
CreateGroupMembershipErrorKind::ConflictException(_)
)
}
/// Returns `true` if the error kind is `CreateGroupMembershipErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
CreateGroupMembershipErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `CreateGroupMembershipErrorKind::ServiceQuotaExceededException`.
pub fn is_service_quota_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
CreateGroupMembershipErrorKind::ServiceQuotaExceededException(_)
)
}
/// Returns `true` if the error kind is `CreateGroupMembershipErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
CreateGroupMembershipErrorKind::ValidationException(_)
)
}
/// Returns `true` if the error kind is `CreateGroupMembershipErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
CreateGroupMembershipErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `CreateGroupMembershipErrorKind::InternalServerException`.
pub fn is_internal_server_exception(&self) -> bool {
matches!(
&self.kind,
CreateGroupMembershipErrorKind::InternalServerException(_)
)
}
/// Returns `true` if the error kind is `CreateGroupMembershipErrorKind::ThrottlingException`.
pub fn is_throttling_exception(&self) -> bool {
matches!(
&self.kind,
CreateGroupMembershipErrorKind::ThrottlingException(_)
)
}
}
impl std::error::Error for CreateGroupMembershipError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
CreateGroupMembershipErrorKind::ConflictException(_inner) => Some(_inner),
CreateGroupMembershipErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
CreateGroupMembershipErrorKind::ServiceQuotaExceededException(_inner) => Some(_inner),
CreateGroupMembershipErrorKind::ValidationException(_inner) => Some(_inner),
CreateGroupMembershipErrorKind::AccessDeniedException(_inner) => Some(_inner),
CreateGroupMembershipErrorKind::InternalServerException(_inner) => Some(_inner),
CreateGroupMembershipErrorKind::ThrottlingException(_inner) => Some(_inner),
CreateGroupMembershipErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
/// Error type for the `DeleteGroupMembership` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DeleteGroupMembershipError {
/// Kind of error that occurred.
pub kind: DeleteGroupMembershipErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for DeleteGroupMembershipError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: DeleteGroupMembershipErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
/// Types of errors that can occur for the `DeleteGroupMembership` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DeleteGroupMembershipErrorKind {
/// <p>This request cannot be completed for one of the following reasons:</p>
/// <ul>
/// <li> <p>Performing the requested operation would violate an existing uniqueness claim in the identity store. Resolve the conflict before retrying this request.</p> </li>
/// <li> <p>The requested resource was being concurrently modified by another request.</p> </li>
/// </ul>
ConflictException(crate::error::ConflictException),
/// <p>Indicates that a requested resource is not found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>The request failed because it contains a syntax error.</p>
ValidationException(crate::error::ValidationException),
/// <p>You do not have sufficient access to perform this action.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>The request processing has failed because of an unknown error, exception or failure with an internal server.</p>
InternalServerException(crate::error::InternalServerException),
/// <p>Indicates that the principal has crossed the throttling limits of the API operations.</p>
ThrottlingException(crate::error::ThrottlingException),
///
/// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
///
/// When logging an error from the SDK, it is recommended that you either wrap the error in
/// [`DisplayErrorContext`](crate::types::DisplayErrorContext), use another
/// error reporter library that visits the error's cause/source chain, or call
/// [`Error::source`](std::error::Error::source) for more details about the underlying cause.
///
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for DeleteGroupMembershipError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DeleteGroupMembershipErrorKind::ConflictException(_inner) => _inner.fmt(f),
DeleteGroupMembershipErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
DeleteGroupMembershipErrorKind::ValidationException(_inner) => _inner.fmt(f),
DeleteGroupMembershipErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
DeleteGroupMembershipErrorKind::InternalServerException(_inner) => _inner.fmt(f),
DeleteGroupMembershipErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
DeleteGroupMembershipErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DeleteGroupMembershipError {
fn code(&self) -> Option<&str> {
DeleteGroupMembershipError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
match &self.kind {
DeleteGroupMembershipErrorKind::InternalServerException(inner) => {
Some(inner.retryable_error_kind())
}
DeleteGroupMembershipErrorKind::ThrottlingException(inner) => {
Some(inner.retryable_error_kind())
}
_ => None,
}
}
}
impl DeleteGroupMembershipError {
/// Creates a new `DeleteGroupMembershipError`.
pub fn new(kind: DeleteGroupMembershipErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `DeleteGroupMembershipError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: DeleteGroupMembershipErrorKind::Unhandled(crate::error::Unhandled::new(
err.into(),
)),
meta: Default::default(),
}
}
/// Creates the `DeleteGroupMembershipError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DeleteGroupMembershipErrorKind::Unhandled(crate::error::Unhandled::new(
err.into(),
)),
}
}
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `DeleteGroupMembershipErrorKind::ConflictException`.
pub fn is_conflict_exception(&self) -> bool {
matches!(
&self.kind,
DeleteGroupMembershipErrorKind::ConflictException(_)
)
}
/// Returns `true` if the error kind is `DeleteGroupMembershipErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
DeleteGroupMembershipErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `DeleteGroupMembershipErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
DeleteGroupMembershipErrorKind::ValidationException(_)
)
}
/// Returns `true` if the error kind is `DeleteGroupMembershipErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
DeleteGroupMembershipErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `DeleteGroupMembershipErrorKind::InternalServerException`.
pub fn is_internal_server_exception(&self) -> bool {
matches!(
&self.kind,
DeleteGroupMembershipErrorKind::InternalServerException(_)
)
}
/// Returns `true` if the error kind is `DeleteGroupMembershipErrorKind::ThrottlingException`.
pub fn is_throttling_exception(&self) -> bool {
matches!(
&self.kind,
DeleteGroupMembershipErrorKind::ThrottlingException(_)
)
}
}
impl std::error::Error for DeleteGroupMembershipError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DeleteGroupMembershipErrorKind::ConflictException(_inner) => Some(_inner),
DeleteGroupMembershipErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
DeleteGroupMembershipErrorKind::ValidationException(_inner) => Some(_inner),
DeleteGroupMembershipErrorKind::AccessDeniedException(_inner) => Some(_inner),
DeleteGroupMembershipErrorKind::InternalServerException(_inner) => Some(_inner),
DeleteGroupMembershipErrorKind::ThrottlingException(_inner) => Some(_inner),
DeleteGroupMembershipErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
/// Error type for the `DescribeGroupMembership` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DescribeGroupMembershipError {
/// Kind of error that occurred.
pub kind: DescribeGroupMembershipErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for DescribeGroupMembershipError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: DescribeGroupMembershipErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
/// Types of errors that can occur for the `DescribeGroupMembership` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DescribeGroupMembershipErrorKind {
/// <p>Indicates that a requested resource is not found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>The request failed because it contains a syntax error.</p>
ValidationException(crate::error::ValidationException),
/// <p>You do not have sufficient access to perform this action.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>The request processing has failed because of an unknown error, exception or failure with an internal server.</p>
InternalServerException(crate::error::InternalServerException),
/// <p>Indicates that the principal has crossed the throttling limits of the API operations.</p>
ThrottlingException(crate::error::ThrottlingException),
///
/// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
///
/// When logging an error from the SDK, it is recommended that you either wrap the error in
/// [`DisplayErrorContext`](crate::types::DisplayErrorContext), use another
/// error reporter library that visits the error's cause/source chain, or call
/// [`Error::source`](std::error::Error::source) for more details about the underlying cause.
///
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for DescribeGroupMembershipError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DescribeGroupMembershipErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
DescribeGroupMembershipErrorKind::ValidationException(_inner) => _inner.fmt(f),
DescribeGroupMembershipErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
DescribeGroupMembershipErrorKind::InternalServerException(_inner) => _inner.fmt(f),
DescribeGroupMembershipErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
DescribeGroupMembershipErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DescribeGroupMembershipError {
fn code(&self) -> Option<&str> {
DescribeGroupMembershipError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
match &self.kind {
DescribeGroupMembershipErrorKind::InternalServerException(inner) => {
Some(inner.retryable_error_kind())
}
DescribeGroupMembershipErrorKind::ThrottlingException(inner) => {
Some(inner.retryable_error_kind())
}
_ => None,
}
}
}
impl DescribeGroupMembershipError {
/// Creates a new `DescribeGroupMembershipError`.
pub fn new(kind: DescribeGroupMembershipErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `DescribeGroupMembershipError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: DescribeGroupMembershipErrorKind::Unhandled(crate::error::Unhandled::new(
err.into(),
)),
meta: Default::default(),
}
}
/// Creates the `DescribeGroupMembershipError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DescribeGroupMembershipErrorKind::Unhandled(crate::error::Unhandled::new(
err.into(),
)),
}
}
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `DescribeGroupMembershipErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
DescribeGroupMembershipErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `DescribeGroupMembershipErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
DescribeGroupMembershipErrorKind::ValidationException(_)
)
}
/// Returns `true` if the error kind is `DescribeGroupMembershipErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
DescribeGroupMembershipErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `DescribeGroupMembershipErrorKind::InternalServerException`.
pub fn is_internal_server_exception(&self) -> bool {
matches!(
&self.kind,
DescribeGroupMembershipErrorKind::InternalServerException(_)
)
}
/// Returns `true` if the error kind is `DescribeGroupMembershipErrorKind::ThrottlingException`.
pub fn is_throttling_exception(&self) -> bool {
matches!(
&self.kind,
DescribeGroupMembershipErrorKind::ThrottlingException(_)
)
}
}
impl std::error::Error for DescribeGroupMembershipError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DescribeGroupMembershipErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
DescribeGroupMembershipErrorKind::ValidationException(_inner) => Some(_inner),
DescribeGroupMembershipErrorKind::AccessDeniedException(_inner) => Some(_inner),
DescribeGroupMembershipErrorKind::InternalServerException(_inner) => Some(_inner),
DescribeGroupMembershipErrorKind::ThrottlingException(_inner) => Some(_inner),
DescribeGroupMembershipErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
/// Error type for the `ListGroupMembershipsForMember` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListGroupMembershipsForMemberError {
/// Kind of error that occurred.
pub kind: ListGroupMembershipsForMemberErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for ListGroupMembershipsForMemberError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: ListGroupMembershipsForMemberErrorKind::Unhandled(crate::error::Unhandled::new(
source,
)),
meta: Default::default(),
}
}
}
/// Types of errors that can occur for the `ListGroupMembershipsForMember` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListGroupMembershipsForMemberErrorKind {
/// <p>Indicates that a requested resource is not found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>The request failed because it contains a syntax error.</p>
ValidationException(crate::error::ValidationException),
/// <p>You do not have sufficient access to perform this action.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>The request processing has failed because of an unknown error, exception or failure with an internal server.</p>
InternalServerException(crate::error::InternalServerException),
/// <p>Indicates that the principal has crossed the throttling limits of the API operations.</p>
ThrottlingException(crate::error::ThrottlingException),
///
/// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
///
/// When logging an error from the SDK, it is recommended that you either wrap the error in
/// [`DisplayErrorContext`](crate::types::DisplayErrorContext), use another
/// error reporter library that visits the error's cause/source chain, or call
/// [`Error::source`](std::error::Error::source) for more details about the underlying cause.
///
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for ListGroupMembershipsForMemberError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListGroupMembershipsForMemberErrorKind::ResourceNotFoundException(_inner) => {
_inner.fmt(f)
}
ListGroupMembershipsForMemberErrorKind::ValidationException(_inner) => _inner.fmt(f),
ListGroupMembershipsForMemberErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
ListGroupMembershipsForMemberErrorKind::InternalServerException(_inner) => {
_inner.fmt(f)
}
ListGroupMembershipsForMemberErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
ListGroupMembershipsForMemberErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListGroupMembershipsForMemberError {
fn code(&self) -> Option<&str> {
ListGroupMembershipsForMemberError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
match &self.kind {
ListGroupMembershipsForMemberErrorKind::InternalServerException(inner) => {
Some(inner.retryable_error_kind())
}
ListGroupMembershipsForMemberErrorKind::ThrottlingException(inner) => {
Some(inner.retryable_error_kind())
}
_ => None,
}
}
}
impl ListGroupMembershipsForMemberError {
/// Creates a new `ListGroupMembershipsForMemberError`.
pub fn new(
kind: ListGroupMembershipsForMemberErrorKind,
meta: aws_smithy_types::Error,
) -> Self {
Self { kind, meta }
}
/// Creates the `ListGroupMembershipsForMemberError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: ListGroupMembershipsForMemberErrorKind::Unhandled(crate::error::Unhandled::new(
err.into(),
)),
meta: Default::default(),
}
}
/// Creates the `ListGroupMembershipsForMemberError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListGroupMembershipsForMemberErrorKind::Unhandled(crate::error::Unhandled::new(
err.into(),
)),
}
}
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `ListGroupMembershipsForMemberErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
ListGroupMembershipsForMemberErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `ListGroupMembershipsForMemberErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
ListGroupMembershipsForMemberErrorKind::ValidationException(_)
)
}
/// Returns `true` if the error kind is `ListGroupMembershipsForMemberErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
ListGroupMembershipsForMemberErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `ListGroupMembershipsForMemberErrorKind::InternalServerException`.
pub fn is_internal_server_exception(&self) -> bool {
matches!(
&self.kind,
ListGroupMembershipsForMemberErrorKind::InternalServerException(_)
)
}
/// Returns `true` if the error kind is `ListGroupMembershipsForMemberErrorKind::ThrottlingException`.
pub fn is_throttling_exception(&self) -> bool {
matches!(
&self.kind,
ListGroupMembershipsForMemberErrorKind::ThrottlingException(_)
)
}
}
impl std::error::Error for ListGroupMembershipsForMemberError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListGroupMembershipsForMemberErrorKind::ResourceNotFoundException(_inner) => {
Some(_inner)
}
ListGroupMembershipsForMemberErrorKind::ValidationException(_inner) => Some(_inner),
ListGroupMembershipsForMemberErrorKind::AccessDeniedException(_inner) => Some(_inner),
ListGroupMembershipsForMemberErrorKind::InternalServerException(_inner) => Some(_inner),
ListGroupMembershipsForMemberErrorKind::ThrottlingException(_inner) => Some(_inner),
ListGroupMembershipsForMemberErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
/// Error type for the `IsMemberInGroups` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct IsMemberInGroupsError {
/// Kind of error that occurred.
pub kind: IsMemberInGroupsErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for IsMemberInGroupsError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: IsMemberInGroupsErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
/// Types of errors that can occur for the `IsMemberInGroups` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum IsMemberInGroupsErrorKind {
/// <p>Indicates that a requested resource is not found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>The request failed because it contains a syntax error.</p>
ValidationException(crate::error::ValidationException),
/// <p>You do not have sufficient access to perform this action.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>The request processing has failed because of an unknown error, exception or failure with an internal server.</p>
InternalServerException(crate::error::InternalServerException),
/// <p>Indicates that the principal has crossed the throttling limits of the API operations.</p>
ThrottlingException(crate::error::ThrottlingException),
///
/// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
///
/// When logging an error from the SDK, it is recommended that you either wrap the error in
/// [`DisplayErrorContext`](crate::types::DisplayErrorContext), use another
/// error reporter library that visits the error's cause/source chain, or call
/// [`Error::source`](std::error::Error::source) for more details about the underlying cause.
///
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for IsMemberInGroupsError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
IsMemberInGroupsErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
IsMemberInGroupsErrorKind::ValidationException(_inner) => _inner.fmt(f),
IsMemberInGroupsErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
IsMemberInGroupsErrorKind::InternalServerException(_inner) => _inner.fmt(f),
IsMemberInGroupsErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
IsMemberInGroupsErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for IsMemberInGroupsError {
fn code(&self) -> Option<&str> {
IsMemberInGroupsError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
match &self.kind {
IsMemberInGroupsErrorKind::InternalServerException(inner) => {
Some(inner.retryable_error_kind())
}
IsMemberInGroupsErrorKind::ThrottlingException(inner) => {
Some(inner.retryable_error_kind())
}
_ => None,
}
}
}
impl IsMemberInGroupsError {
/// Creates a new `IsMemberInGroupsError`.
pub fn new(kind: IsMemberInGroupsErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `IsMemberInGroupsError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: IsMemberInGroupsErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
/// Creates the `IsMemberInGroupsError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: IsMemberInGroupsErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `IsMemberInGroupsErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
IsMemberInGroupsErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `IsMemberInGroupsErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
IsMemberInGroupsErrorKind::ValidationException(_)
)
}
/// Returns `true` if the error kind is `IsMemberInGroupsErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
IsMemberInGroupsErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `IsMemberInGroupsErrorKind::InternalServerException`.
pub fn is_internal_server_exception(&self) -> bool {
matches!(
&self.kind,
IsMemberInGroupsErrorKind::InternalServerException(_)
)
}
/// Returns `true` if the error kind is `IsMemberInGroupsErrorKind::ThrottlingException`.
pub fn is_throttling_exception(&self) -> bool {
matches!(
&self.kind,
IsMemberInGroupsErrorKind::ThrottlingException(_)
)
}
}
impl std::error::Error for IsMemberInGroupsError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
IsMemberInGroupsErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
IsMemberInGroupsErrorKind::ValidationException(_inner) => Some(_inner),
IsMemberInGroupsErrorKind::AccessDeniedException(_inner) => Some(_inner),
IsMemberInGroupsErrorKind::InternalServerException(_inner) => Some(_inner),
IsMemberInGroupsErrorKind::ThrottlingException(_inner) => Some(_inner),
IsMemberInGroupsErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
/// Error type for the `GetUserId` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct GetUserIdError {
/// Kind of error that occurred.
pub kind: GetUserIdErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for GetUserIdError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: GetUserIdErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
/// Types of errors that can occur for the `GetUserId` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum GetUserIdErrorKind {
/// <p>Indicates that a requested resource is not found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>The request failed because it contains a syntax error.</p>
ValidationException(crate::error::ValidationException),
/// <p>You do not have sufficient access to perform this action.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>The request processing has failed because of an unknown error, exception or failure with an internal server.</p>
InternalServerException(crate::error::InternalServerException),
/// <p>Indicates that the principal has crossed the throttling limits of the API operations.</p>
ThrottlingException(crate::error::ThrottlingException),
///
/// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
///
/// When logging an error from the SDK, it is recommended that you either wrap the error in
/// [`DisplayErrorContext`](crate::types::DisplayErrorContext), use another
/// error reporter library that visits the error's cause/source chain, or call
/// [`Error::source`](std::error::Error::source) for more details about the underlying cause.
///
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for GetUserIdError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
GetUserIdErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
GetUserIdErrorKind::ValidationException(_inner) => _inner.fmt(f),
GetUserIdErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
GetUserIdErrorKind::InternalServerException(_inner) => _inner.fmt(f),
GetUserIdErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
GetUserIdErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for GetUserIdError {
fn code(&self) -> Option<&str> {
GetUserIdError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
match &self.kind {
GetUserIdErrorKind::InternalServerException(inner) => {
Some(inner.retryable_error_kind())
}
GetUserIdErrorKind::ThrottlingException(inner) => Some(inner.retryable_error_kind()),
_ => None,
}
}
}
impl GetUserIdError {
/// Creates a new `GetUserIdError`.
pub fn new(kind: GetUserIdErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `GetUserIdError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: GetUserIdErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
/// Creates the `GetUserIdError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: GetUserIdErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `GetUserIdErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(&self.kind, GetUserIdErrorKind::ResourceNotFoundException(_))
}
/// Returns `true` if the error kind is `GetUserIdErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, GetUserIdErrorKind::ValidationException(_))
}
/// Returns `true` if the error kind is `GetUserIdErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, GetUserIdErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `GetUserIdErrorKind::InternalServerException`.
pub fn is_internal_server_exception(&self) -> bool {
matches!(&self.kind, GetUserIdErrorKind::InternalServerException(_))
}
/// Returns `true` if the error kind is `GetUserIdErrorKind::ThrottlingException`.
pub fn is_throttling_exception(&self) -> bool {
matches!(&self.kind, GetUserIdErrorKind::ThrottlingException(_))
}
}
impl std::error::Error for GetUserIdError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
GetUserIdErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
GetUserIdErrorKind::ValidationException(_inner) => Some(_inner),
GetUserIdErrorKind::AccessDeniedException(_inner) => Some(_inner),
GetUserIdErrorKind::InternalServerException(_inner) => Some(_inner),
GetUserIdErrorKind::ThrottlingException(_inner) => Some(_inner),
GetUserIdErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
/// Error type for the `GetGroupMembershipId` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct GetGroupMembershipIdError {
/// Kind of error that occurred.
pub kind: GetGroupMembershipIdErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for GetGroupMembershipIdError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: GetGroupMembershipIdErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
/// Types of errors that can occur for the `GetGroupMembershipId` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum GetGroupMembershipIdErrorKind {
/// <p>Indicates that a requested resource is not found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>The request failed because it contains a syntax error.</p>
ValidationException(crate::error::ValidationException),
/// <p>You do not have sufficient access to perform this action.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>The request processing has failed because of an unknown error, exception or failure with an internal server.</p>
InternalServerException(crate::error::InternalServerException),
/// <p>Indicates that the principal has crossed the throttling limits of the API operations.</p>
ThrottlingException(crate::error::ThrottlingException),
///
/// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
///
/// When logging an error from the SDK, it is recommended that you either wrap the error in
/// [`DisplayErrorContext`](crate::types::DisplayErrorContext), use another
/// error reporter library that visits the error's cause/source chain, or call
/// [`Error::source`](std::error::Error::source) for more details about the underlying cause.
///
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for GetGroupMembershipIdError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
GetGroupMembershipIdErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
GetGroupMembershipIdErrorKind::ValidationException(_inner) => _inner.fmt(f),
GetGroupMembershipIdErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
GetGroupMembershipIdErrorKind::InternalServerException(_inner) => _inner.fmt(f),
GetGroupMembershipIdErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
GetGroupMembershipIdErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for GetGroupMembershipIdError {
fn code(&self) -> Option<&str> {
GetGroupMembershipIdError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
match &self.kind {
GetGroupMembershipIdErrorKind::InternalServerException(inner) => {
Some(inner.retryable_error_kind())
}
GetGroupMembershipIdErrorKind::ThrottlingException(inner) => {
Some(inner.retryable_error_kind())
}
_ => None,
}
}
}
impl GetGroupMembershipIdError {
/// Creates a new `GetGroupMembershipIdError`.
pub fn new(kind: GetGroupMembershipIdErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `GetGroupMembershipIdError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: GetGroupMembershipIdErrorKind::Unhandled(crate::error::Unhandled::new(
err.into(),
)),
meta: Default::default(),
}
}
/// Creates the `GetGroupMembershipIdError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: GetGroupMembershipIdErrorKind::Unhandled(crate::error::Unhandled::new(
err.into(),
)),
}
}
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `GetGroupMembershipIdErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
GetGroupMembershipIdErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `GetGroupMembershipIdErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
GetGroupMembershipIdErrorKind::ValidationException(_)
)
}
/// Returns `true` if the error kind is `GetGroupMembershipIdErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
GetGroupMembershipIdErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `GetGroupMembershipIdErrorKind::InternalServerException`.
pub fn is_internal_server_exception(&self) -> bool {
matches!(
&self.kind,
GetGroupMembershipIdErrorKind::InternalServerException(_)
)
}
/// Returns `true` if the error kind is `GetGroupMembershipIdErrorKind::ThrottlingException`.
pub fn is_throttling_exception(&self) -> bool {
matches!(
&self.kind,
GetGroupMembershipIdErrorKind::ThrottlingException(_)
)
}
}
impl std::error::Error for GetGroupMembershipIdError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
GetGroupMembershipIdErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
GetGroupMembershipIdErrorKind::ValidationException(_inner) => Some(_inner),
GetGroupMembershipIdErrorKind::AccessDeniedException(_inner) => Some(_inner),
GetGroupMembershipIdErrorKind::InternalServerException(_inner) => Some(_inner),
GetGroupMembershipIdErrorKind::ThrottlingException(_inner) => Some(_inner),
GetGroupMembershipIdErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
/// Error type for the `GetGroupId` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct GetGroupIdError {
/// Kind of error that occurred.
pub kind: GetGroupIdErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for GetGroupIdError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: GetGroupIdErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
/// Types of errors that can occur for the `GetGroupId` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum GetGroupIdErrorKind {
/// <p>Indicates that a requested resource is not found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>The request failed because it contains a syntax error.</p>
ValidationException(crate::error::ValidationException),
/// <p>You do not have sufficient access to perform this action.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>The request processing has failed because of an unknown error, exception or failure with an internal server.</p>
InternalServerException(crate::error::InternalServerException),
/// <p>Indicates that the principal has crossed the throttling limits of the API operations.</p>
ThrottlingException(crate::error::ThrottlingException),
///
/// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
///
/// When logging an error from the SDK, it is recommended that you either wrap the error in
/// [`DisplayErrorContext`](crate::types::DisplayErrorContext), use another
/// error reporter library that visits the error's cause/source chain, or call
/// [`Error::source`](std::error::Error::source) for more details about the underlying cause.
///
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for GetGroupIdError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
GetGroupIdErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
GetGroupIdErrorKind::ValidationException(_inner) => _inner.fmt(f),
GetGroupIdErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
GetGroupIdErrorKind::InternalServerException(_inner) => _inner.fmt(f),
GetGroupIdErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
GetGroupIdErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for GetGroupIdError {
fn code(&self) -> Option<&str> {
GetGroupIdError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
match &self.kind {
GetGroupIdErrorKind::InternalServerException(inner) => {
Some(inner.retryable_error_kind())
}
GetGroupIdErrorKind::ThrottlingException(inner) => Some(inner.retryable_error_kind()),
_ => None,
}
}
}
impl GetGroupIdError {
/// Creates a new `GetGroupIdError`.
pub fn new(kind: GetGroupIdErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `GetGroupIdError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: GetGroupIdErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
/// Creates the `GetGroupIdError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: GetGroupIdErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `GetGroupIdErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
GetGroupIdErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `GetGroupIdErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, GetGroupIdErrorKind::ValidationException(_))
}
/// Returns `true` if the error kind is `GetGroupIdErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, GetGroupIdErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `GetGroupIdErrorKind::InternalServerException`.
pub fn is_internal_server_exception(&self) -> bool {
matches!(&self.kind, GetGroupIdErrorKind::InternalServerException(_))
}
/// Returns `true` if the error kind is `GetGroupIdErrorKind::ThrottlingException`.
pub fn is_throttling_exception(&self) -> bool {
matches!(&self.kind, GetGroupIdErrorKind::ThrottlingException(_))
}
}
impl std::error::Error for GetGroupIdError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
GetGroupIdErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
GetGroupIdErrorKind::ValidationException(_inner) => Some(_inner),
GetGroupIdErrorKind::AccessDeniedException(_inner) => Some(_inner),
GetGroupIdErrorKind::InternalServerException(_inner) => Some(_inner),
GetGroupIdErrorKind::ThrottlingException(_inner) => Some(_inner),
GetGroupIdErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
///
/// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
///
/// When logging an error from the SDK, it is recommended that you either wrap the error in
/// [`DisplayErrorContext`](crate::types::DisplayErrorContext), use another
/// error reporter library that visits the error's cause/source chain, or call
/// [`Error::source`](std::error::Error::source) for more details about the underlying cause.
///
#[derive(Debug)]
pub struct Unhandled {
source: Box<dyn std::error::Error + Send + Sync + 'static>,
}
impl Unhandled {
#[allow(unused)]
pub(crate) fn new(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self { source }
}
}
impl std::fmt::Display for Unhandled {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "unhandled error")
}
}
impl std::error::Error for Unhandled {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
Some(self.source.as_ref() as _)
}
}