Skip to content

CognitoIdentityProviderClient#

Index > CognitoIdentityProvider > CognitoIdentityProviderClient

Auto-generated documentation for CognitoIdentityProvider type annotations stubs module mypy-boto3-cognito-idp.

CognitoIdentityProviderClient#

Type annotations and code completion for boto3.client("cognito-idp"). boto3 documentation

# CognitoIdentityProviderClient usage example

from boto3.session import Session
from mypy_boto3_cognito_idp.client import CognitoIdentityProviderClient

def get_cognito-idp_client() -> CognitoIdentityProviderClient:
    return Session().client("cognito-idp")

Exceptions#

boto3 client exceptions are generated in runtime. This class provides code completion for boto3.client("cognito-idp").exceptions structure.

# Exceptions.exceptions usage example

client = boto3.client("cognito-idp")

try:
    do_something(client)
except (
    client.exceptions.AliasExistsException,
    client.exceptions.ClientError,
    client.exceptions.CodeDeliveryFailureException,
    client.exceptions.CodeMismatchException,
    client.exceptions.ConcurrentModificationException,
    client.exceptions.DuplicateProviderException,
    client.exceptions.EnableSoftwareTokenMFAException,
    client.exceptions.ExpiredCodeException,
    client.exceptions.ForbiddenException,
    client.exceptions.GroupExistsException,
    client.exceptions.InternalErrorException,
    client.exceptions.InvalidEmailRoleAccessPolicyException,
    client.exceptions.InvalidLambdaResponseException,
    client.exceptions.InvalidOAuthFlowException,
    client.exceptions.InvalidParameterException,
    client.exceptions.InvalidPasswordException,
    client.exceptions.InvalidSmsRoleAccessPolicyException,
    client.exceptions.InvalidSmsRoleTrustRelationshipException,
    client.exceptions.InvalidUserPoolConfigurationException,
    client.exceptions.LimitExceededException,
    client.exceptions.MFAMethodNotFoundException,
    client.exceptions.NotAuthorizedException,
    client.exceptions.PasswordHistoryPolicyViolationException,
    client.exceptions.PasswordResetRequiredException,
    client.exceptions.PreconditionNotMetException,
    client.exceptions.ResourceNotFoundException,
    client.exceptions.ScopeDoesNotExistException,
    client.exceptions.SoftwareTokenMFANotFoundException,
    client.exceptions.TooManyFailedAttemptsException,
    client.exceptions.TooManyRequestsException,
    client.exceptions.UnauthorizedException,
    client.exceptions.UnexpectedLambdaException,
    client.exceptions.UnsupportedIdentityProviderException,
    client.exceptions.UnsupportedOperationException,
    client.exceptions.UnsupportedTokenTypeException,
    client.exceptions.UnsupportedUserStateException,
    client.exceptions.UserImportInProgressException,
    client.exceptions.UserLambdaValidationException,
    client.exceptions.UserNotConfirmedException,
    client.exceptions.UserNotFoundException,
    client.exceptions.UserPoolAddOnNotEnabledException,
    client.exceptions.UserPoolTaggingException,
    client.exceptions.UsernameExistsException,
) as e:
    print(e)
# Exceptions.exceptions type checking example

from mypy_boto3_cognito_idp.client import Exceptions

def handle_error(exc: Exceptions.AliasExistsException) -> None:
    ...

Methods#

add_custom_attributes#

Adds additional user attributes to the user pool schema.

Type annotations and code completion for boto3.client("cognito-idp").add_custom_attributes method.